How To Enable And Disable htaccess In Apache Web Server

How to enable and disable htaccess files provides a way to make configuration on a per-directory basis. you can create htaccess file when you running a website using CMS tools. All the rules and configurations will be kept in this file and how to find htaccess file because this is a hidden file in the directory. you can easily write htaccess file when you have server access otherwise you can also make changes from Yoast plugins. 

Check Out: How To Change Grafana Server Default Port In Linux

Where a file containing one or more configuration directives, is placed in a particular document directory and then it applies to that directory or subdirectories.

How To Enable and Disable htaccess In Apache:

You should use .htaccess file but when you don’t have access to the main server configuration file. 

Check Out: Httpd: Could Not Reliably Determine The Server’s Fully Qualified Domain Name

Note: You must have .htaccess file on your server. If you want to control configuration through that files.

So, You can define these codes between the Virtual-host and define the directory paths according to your needs.

Disable .htaccess in Apache

<Directory “/vaw/www”>
Allowoverride none
</Directory>

Enable .htaccess in Apache

Check Out: Disable HTTP TRACE Or TRACK Request In Httpd

<Directory “/vaw/www/html”>
Allowoverride all
</Directory>

That’s itcreate htaccess file how to find htaccess write htaccess file write rules in htaccess

Share on:

I'm the founder of Curious Viral. I hope this blog will provide you complete information about Linux Technology & I would like to share my technical knowledge with you which I have learned during this period.

Other Posts You May Like...

Leave a comment