Page 1 of 1

mod_rewrite on XP

PostPosted: 14. April 2009 18:50
by schizoman
Okay, what am I doing wrong? I'm running XAMPP on Windows XP, and am trying to get mod_rewrite to work. In httpd.conf, I uncommented the appropriate LoadModule, and moved it to directly above the mod_cache line:

LoadModule rewrite_module modules/mod_rewrite.so
#LoadModule cache_module modules/mod_cache.so

I changed every AllowOverride to All:

AllowOverride All


Then, at the bottom, I placed the following two lines:

RewriteEngine on
RewriteRule ^test1.html$ test2.html

I restarted apache. (I even tried rebooting Windows.) At first, both test1.html and test2.html were in the test directory. Going to test1.html showed the contents of test1.html. If I delete test1.html, I get a 404 error.

phpinfo() shows mod_rewrite as active.

Can anyone help? Thanks.

Re: mod_rewrite on XP

PostPosted: 14. April 2009 19:11
by Wiedmann
In httpd.conf, I uncommented the appropriate LoadModule,

That's all you must do.

Code: Select all
RewriteRule ^test1.html$ test2.html

Can anyone help?

Your rule can't match if used in httpd.conf main context.

(Inside a Directory tag or a .htaccess file this rule can match)