[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache mod_rewrite

On Mon, Sep 04, 2000 at 06:20:09PM +0000, Jaume Teixi wrote:
> I'm still getting 404  RewriteLog shows:
> ' pattern='^www\.[^.]+$' => not-matched
> whats happening ?

i wasn't paying enough attention to your rules. they can't work as
written. you want to look at the SERVER_NAME variable, not HTTP_HOST.

also, turn on mod_rewrite logging, and increase the log level to help
diagnose any faults. the rule below is untested, you'll probably have to
tweak it a bit to get it working.

remember to set loglevel back to 0 or 2 or whatever once you've got it
working.  high logging levels will slow down your apache server.

try something like:

	RewriteLog "/var/log/apache/rewrite.log"
	Rewrite Loglevel 9

	RewriteEngine on
	RewriteRule	^/stats(/.*)			/reports/%{SERVER_NAME}$1


	RewriteRule	^/stats/(.*)			/reports/%{SERVER_NAME}/$1

(without testing, i'm not sure which form is better).

you still need the Alias definition from my last message.

then make sure that your stats processing software puts the results in a
subdirectory under /var/reports which has exactly the same name as the
ServerName keyword in the the <VirtualHost>...</VirtualHost> config.

e.g. if you have a virtual host with ServerName www.foo.com then the
reports for that host should go in /var/reports/www.foo.com/


craig sanders

Reply to: