To enable .htaccess files on your server, edit “/etc/apache2/sites-available/default” file, change AllowOverride to All
NameVirtualHost *
<VirtualHost *>
ServerAdmin admin@site.com
DocumentRoot /var/www/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
#RedirectMatch ^/$ /apache2-default/
</Directory>
Then restart apache by doing “/etc/init.d/apache2 restart to restart apache”
Try to see if everything is working fine, if not, check your apache logs in /var/log/apache2, if you have the following error “/var/www/.htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration”
simply do “sudo a2enmod rewrite” and restart apache again and all should work fine!
you’re a life saver…thank you so much for posting this.
Thanks!!