Disable Script Execution Using .htaccess

You can disable scripts being run in the directory of your choice by adding the following code to your .htaccess file in that directory

This would be particularly useful if you allow visitors to upload files to your server, but want to be sure that any potentially harmful files they upload are not allowed to execute.

AddHandler cgi-script .php .pl .jsp .asp .sh .cgi
Options -ExecCGI

You can replace the file types in the example with the file types you wish to disallow using .htaccess.

Trackback URI | Comments RSS

Leave a Reply

You must be logged in to post a comment.