I developed a web app on my Mac using MAMP. The app uses a .htaccess file, which is contained in the root directory. Everything worked great when testing on my local MAMP environment. However, when I moved to my hosted server (dedicated server running Red Hat Linux), my rewrite rules in the .htaccess file are not working properly. For example, when a user logs in to my site the rewrite rule takes them to http://www.mysite.com/authenticate/login as it should (it appears the rewrite rule in .htaccess worked). However, I get a 404 file not found error. Can anyone see what the problem is? Here is the code in the .htaccess file:
ErrorDocument 404 /index.php
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]
</IfModule>
Options -indexes
Is the
AllowOverridedirective correctly set on the production server?http://httpd.apache.org/docs/2.0/mod/core.html#allowoverride