How to tell Apache to process .htaccess files
I just need to write something about this since I’ve been a victim of configuration overload lately. While I was setting up a demo site for a client, I kept of wondering why the site is not functioning properly. All RewriteRule entries are being ignored by Apache.
The idea that Apache may not be allowing .htaccess didn’t come to my mind at first. I deliberately put in invalid characters inside the .htaccess file hoping that Apache would throw in some server error message but it did not! Then I remember the keyword AllowOverride None. Aparently, this is the default setting in Apache (so don’t mess with it!). I had to put a custom setting for a specific directory in order for .htaccess to work. Here is a sample configuration on how to allow .htaccess to specific directory (assuming your files are in /var/www/sitea).
<Directory /var/www/sitea>
AllowOverride All
</Directory>
AllowOverride can accept other values (except none) for fine-grain control. It can be embedded inside a <VirtualHost></VirtualHost> for specific needs (which I did) or just put it along with other global entries. Now .htaccess should work without a hitch!
This is only applicable to individual that has a superuser access to a system.