mod_rewrite in apache2
From: 'Dungeon' Dave (Newsgroup_at_tombstones.org.uk)
Date: 10/21/04
- Next message: Gonzalo: "File permissions problems..."
- Previous message: Michael Heiming: "Re: How can I mount an mp3 player in Fedora Core 2?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 21 Oct 2004 19:34:11 +0100
Anyone here an apache wiz?
I've read through the apache docs on mod_rewrite and read Ralf
Engelschall's rewriting guide but I'm still no clearer on this one.
Here's me problem: I've got two webservers that offer two sites:
www.external.com and www.internal.com (for instance) - both are behind a
router, and the DNS records point to the same IP address. So far, so
good.
However, I can only NAT the external IP address to one of the
webservers. So I've got the router to point at the first webserver and
thought of setting up internal.com as a virtual domain on this server,
but then using mod_rewrite to forward traffic to the second server,
allowing it to tunnel through. I'm trying to use a rule that states:
www.internal.com/(.+) -> rewrite to: inside.internal.com/$1
So far, my attempts have failed. I've tried the following as a test:
--- code ---
<Directory "/home/httpd/sites/www.external.com/web/internal/">
Order allow,deny
Allow from all
RewriteEngine On
RewriteBase /external
RewriteRule ^/external/(.+) http://www.internal.com/$1 [R,L]
</Directory>
---- But the apache logs complain that the "internal" directory doesn't exist. If I create it, then it finds an empty directory - ie: seems to ignore the rewrite. Anyone got a suitable example I can play with? -- "I call up my friend, the good angel But she's out with her answerphone."
- Next message: Gonzalo: "File permissions problems..."
- Previous message: Michael Heiming: "Re: How can I mount an mp3 player in Fedora Core 2?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|