Share Article To

Here we will learn How to enable or allow htaccess file on apache server to override your default server configurations. But before that we will quickly see what is htaccess file.

What is htaccess file?

How to enable or allow htaccess file on apache server

htaccess is a hypertext access file using which web master can override the Apache server default configurations as per their requirement.

Such modifications of default configurations are applicable on directory in which .htaccess file is resides and on all the succeeding directories.

But before you start writing any code in .htaccess file you have to confirm whether this file has permission to override the default configuration or not.


Now a days almost all hosting provider already allowed the permission to .htaccess file to override the server default configurations for the web masters.

But if you owned a dedicated server and you are the owner of apache services installation then you need to do some modification in Apache server configuration file (i.e., httpd.conf) to allow .htaccess file to override you server’s default configurations.

So here are the step to allow .htaccess file to override server configurations
Step 1: Find and open server configuration file(may be httpd.conf or apache2.conf)
For Windows:
– Open local drive in which apache installed
– Go to \apache\conf\ or go to \xampp\apache\conf
– Find file httpd.conf and open in editor
For Fedora Core, CentOS, RHEL:
– Go to /etc/httpd/conf/
– Find file httpd.conf and open in editor
For Debian, Ubuntu:
– Go to /etc/apache2/
– Find file apache2.conf and open in editor
– For more help on finding server configuration file follow the link

Step 2:  Search for below line of code in above file.
AllowOverride None
replace the above line by
AllowOverride All

Step 3: Restart apache/httpd services
In linux: service httpd restart

Step 4: Now you must able to override you server default configurations using .htaccess file

Hope above helps 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *