I have a base install of a LAMP server on my Ubuntu system, and I'm trying to get mod_rewrite working on that local server (the directory of the local site is localhost/project). I added this to my /etc/apache2/httpd.conf file, which was blank before I did so: <Directory /> Options FollowSymLinks AllowOverride All Order deny,allow Deny from all Satisfy all </Directory> Code (markup): and I ran this command to enable mod_rewrite: sudo a2enmod rewrite Code (markup): I have this code in localhost/project/.htaccess, which works on another site on a shared server elsewhere: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond $1 !^(index\.php|ajax|css|error|img|js) RewriteRule ^(.*)$ index.php?url=$1 [PT,L] </IfModule> Code (markup): It's supposed to redirect everything except the listed directories to index.php, which is used as a front controller. However, if I type in http://localhost/project/<any other page> I get a 404 error. Any ideas? Thank you!
Try this rule just to be sure you don't have a rule problem: RewriteEngine On RewriteRule ^(google)$ /google2 If it redirects /google to /google2 you have a problem with your ruleset rather than with config