Disable execution of PHP, Perl, Python, Java in .htaccess

RussianRoot 28/06/2013 0
Disable execution of PHP, Perl, Python, Java in .htaccess

Hello everyone!

Sometimes you need to disable execution of scripts under certain folder using .htaccess. It’s useful if you have any security issue on server and want to stop execution of dynamic languages or disable php in images folder under joomla.

Here is the code:

As we can see, we add cgi-script handler to “.php .pl .py .jsp .asp .htm .shtml .sh .cgi” on the first line and on the second we disable the execution of cgi-script as an Option of apache.

That worked for me, when my server had a PHP shell under /media/ folder, hope it’ll help you too!

Good luck!

Leave A Response »


+ 5 = 12