masthead image

Technology Blog

.htaccess Not Working?

Wednesday February 24 2010, 02:17 PM

If you are having problems with Apache not accessing .htaccess its likely because the AllowOverride directive setting is "None".

By default, httpd.conf looks like this:

<Directory "C:/Apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

Assuming C:/Apache/htdocs is the document root for your website, you must change this to the following:

<Directory "C:/Apache/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

Make sure you save httpd.conf and back it up. Then, restart Apache to have the change take effect.

If you don't do this, .htaccess will be ignored. Now if you don't have access to the Apache server directly (for example you are on a shared host), contact them to make the change or get a new hosting provider.

If you don't want to go through the hassle of figuring out if your host doesn't support .htaccess, use Hostgator. This site happens to be on HostGator and is using .htaccess. I've used them throughout the years and they are affordably priced and very good on support.

If you sign up using Hostgator please use the banner above as we are a Hostgator affilliate. We use the ad revenue to run this website. And if you don't mind please contact me if you have done so. Thank you.