PDA

View Full Version : need help with mod_rewrite on leopard server




twoodcc
Mar 22, 2009, 10:14 PM
so i have a server running 10.5 server, and cannot get mod_rewrite to work. it says that it's installed and everything, according to phpinfo()

but it doesn't work. i have turned it on with httpd.conf and have set the Override to all

any ideas on how to make this work?

thanks in advance



Kaliemon
Mar 22, 2009, 11:44 PM
Did you place your mod_rewrite rules in a .htaccess file in your site's folder and remember to turn on the rewrite engine?

Heres an example that rewrites requests from *.htm to *.php

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [NC]

Don't know your experience with rewrite rules, but if you have already done this, posting your rewrite rules will help with diagnosing problems.

Also try test the rule I posted above by creating a php file and requesting it with .htm and see if you get the php version.

twoodcc
Mar 25, 2009, 08:41 PM
Did you place your mod_rewrite rules in a .htaccess file in your site's folder and remember to turn on the rewrite engine?

Heres an example that rewrites requests from *.htm to *.php

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)\.htm$ $1.php [NC]

Don't know your experience with rewrite rules, but if you have already done this, posting your rewrite rules will help with diagnosing problems.

Also try test the rule I posted above by creating a php file and requesting it with .htm and see if you get the php version.

thanks for the reply. it turns out that i got it to work! i just had to adjust my httpd.conf file and also change the .htaccess file