How to Exclude a File From Apache Limit Directive

We Use limit directive to disallow get put method for a web directory file. Limit directive is best option to restrict access of particular method for directory. Sometime we need to exclude a single file from limit directive so that it work.

In this tutorial, we will see how to exclude a file from Apache limit directive.

Example:

I have disallowed get and put using limit directive as you can see in given below script. This approach will not allow GET request.

<Limit GET PUT DELETE>     
deny from all
</Limit>

To exclude a single file from limit directive using given below script.

<Files "login.php">     
allow from all
</Files>

Adding above code to haccess file will allow to access login.php file using get method.

Leave a Reply

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