Forum Moderators: phranque
However our live site uses mod_rewrite in the .htaccess file, and I'm trying to emulate it here with no joy, I'm getting 500 errors with the simpliest rules in my .htaccess file -- all the rules work on the live site (shared hosting environment)
I think it's an error in my httpd.conf -- the LoadModule rewrite_module modules/mod_rewrite.so was already uncommented.
What else do I need to do to recreate how the host is configured for mod_rewrite?
It would be very helpful to us if you would examine your server error log and post the contents of the log entry for one of these 500-Server Errors. Often, the error log entry will tell you precisely what is wrong.
You'll need to set "AllowOverride" in httpd.conf to include "FileInfo" and "Options". You'll need to set "Options" in httpd.conf or .htaccess to include "FollowSymLinks" or "SymLinksIfOwnerMatch". I recommend you look up these directives in Apache core [httpd.apache.org] before adding them.
Jim
Here's what the logs are saying:
[Mon Jul 25 16:45:07 2005] [alert] [client 192.168.1.143] /var/www/html/.htaccess: Illegal option RewriteEngine
And I have set
Options Indexes FollowSymLinks
AllowOverride All
in my httpd.conf file already
and here's the .htaccess file (test version)
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^test /test.php
And I have set
Options Indexes FollowSymLinks
AllowOverride Allin my httpd.conf file already
and here's the .htaccess file (test version)Options +FollowSymLinks
RewriteEngine OnRewriteRule ^test /test.php
If you have FollowSymLinks in httpd.conf, you won't need it in .htaccess. Your rule, as written, will loop on itself, since the substitution URL matches the pattern. Also, you should use an [L] flag (see mod_rewrite documentation) unless you have reason to do otherwise. Try:
RewriteRule ^test\.html$ /test.php [L]