I have this in my /srv/www/htdocs/.htaccess file:
RewriteEngine On #turn on rewite engine
RewriteRule ^schedule/?$ index.php?page=schedule [NC,L]
RewriteRule ^music/?$ index.php?page=music [NC,L]
RewriteRule ^thefamily/?$ index.php?page=thefamily [NC,L]
RewriteRule ^contact/?$ index.php?page=contact [NC,L]
I go to http://localhost/contact and I get 404 error. On my remote server however, this code in .htaccess works fine. How do I get RewriteRule to work on Apache2? I googled, and read that this command would make it work: # a2enmod rewrite but it did not [I did restart apache2 too].
I even added RewriteEngine On to my /etc/apache2/sites-available/default file [Inside the VirtualHost] but that didn't fix it either.
I'm running it from Ubuntu 11.04. Any help appreciated, thanks!