How to Enable .htaccess File in Apache2

Is your .htaccess file not working and you find it difficult to figure out what’s the issue. Before using .htaccess file you need to enable it.

What’s the use of .htaccess File

.htaccess is Apache’s directory-level configuration file. Using htaccess file you can set directory level configuration without making any changes in httpd.conf file.

My previous posts on .htaccess.

Create Seo-Friendly URL through .htaccess

Deny Access of File and Folder through .htaccess

How to Leverage Browser Caching through .htaccess

How to Enable .htaccess File in Apache2

 

You can edit the server settings to allow the .htaccess file to override standard website configs.

NOTESettings are override for only those directories where .htaccess file is placed.

In apache configuration file AllowOverride directive controls whether .htaccess file is allowed or not.

AllowOverride All It means .htaccess file is allowed. And every time your application starts, Apache reads and apply the directives written in .htaccess file.

AllowOverride None It means ignore .htaccess file.

To edit the settings Open the apache2 default host configuration file and change AllowOverride None to AllowOverride All.

After you done the changes, restart apache.

or

Tagged , , , . Bookmark the permalink.

About WebRewrite

I am technology lover who loves to keep updated with latest technology. My interest field is Web Development.