Disable PHP execution in specefic directory

thomastull

Verified User
Joined
Feb 11, 2014
Messages
10
Hello

Need some help in disabling PHP execution in public_html.

I have a server say X.X.X.X and have one domain on it say domain.com
I need to disallow php execution in public_html but php should execute in sub directories under public_html.

For eg. I want domain.com/test.php won't execute but if its in directory under public_html (domain.com/folder/test.php) it should execute.

Please suggest the methods to disable PHP execution in specefir directory only.
 
Using .htaccess is the only way probably. I dont know if you can overwrite the change in a child folder though.

Code:
<IfModule mod_php5.c>
php_flag engine off
</IfModule>
 
Hello

Thanks for the reply.
I have tried the code in .htaccess, but it didn't worked.
 
Back
Top