Re: Apache mod_rewrite
- To: Jaume Teixi <teixi@6tems.com>
- Cc: brian moore <bem@rom.org>, Debian User <debian-user@lists.debian.org>, debian-isp@lists.debian.org, rse@engelschall.com
- Subject: Re: Apache mod_rewrite
- From: Craig Sanders <cas@taz.net.au>
- Date: Sat, 2 Sep 2000 19:55:42 +1100
- Message-id: <[🔎] 20000902195542.U2523@taz.net.au>
- Mail-followup-to: Craig Sanders <cas@taz.net.au>, Jaume Teixi <teixi@6tems.com>, brian moore <bem@rom.org>, Debian User <debian-user@lists.debian.org>, debian-isp@lists.debian.org, rse@engelschall.com
- In-reply-to: <39AD8826.AF88C8D9@6tems.com>; from teixi@6tems.com on Wed, Aug 30, 2000 at 10:18:14PM +0000
- References: <39AD4C93.EE522BBC@6tems.com> <20000830100016.A10466@rom.org> <39AD8826.AF88C8D9@6tems.com>
On Wed, Aug 30, 2000 at 10:18:14PM +0000, Jaume Teixi wrote:
> I need to do the following in order to access stats for each based
> virtual host
>
> when typing url www.virtualhost1.com/stats or
> www.virtualhost99.com/stats
> server page located under /var/reports/virtualhost1 or
> /var/reports/virtualhost99
>
> I've tryed on my httpd.conf:
>
> RewriteEngine on
> RewriteCond %{HTTP_HOST} ^www\.[^.]+$
> RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
> RewriteRule ^www\.([^.]+)(.*)/stats /var/reports/$1
>
> Apache produces a 404
>
> any points to fix this ?
mod_rewrite rewrites the url, you're confusing it with the path to the
files.
try setting up a global Alias like so:
Alias /reports/ /var/reports/
then use mod_rewrite to rewrite the URL "www.virtual.com/stats" to
"www.virtual.com/reports/virtual.com/". the rewrite above should work, but
the final line should be:
RewriteRule ^www\.([^.]+)(.*)/stats /reports/$1
another way of doing it is to just have a symlink in their document root.
craig
--
craig sanders
Reply to: