hi all, with your help i was able to disable PHP on my web server on folder wise (i.e disable PHP for specific folder) now my company has given me a new challenge to disable PHP on file wise. i.e : I want only to execute some PHP files with specific names and not to execute any other PHP files with different names (e.g : only to run index.php and any other PHP file will not run/no matter where is the location of the file) pls somebody advice me on this
I am doing something like this on one of my sites. Try adding something like this to your .htaccess file. (Assuming you are usign Apache) <FilesMatch "\.php$"> order deny,allow deny from all </FilesMatch> <Files index.php> order allow,deny allow from all </Files> Code (markup): If your server is not using Apache, then do a search in Google for the .htaccess equivilent for your server app.
thanks for the reply I'm using Apache and how do i no whether htaccess is working on my server? is there a way to check that?
instead of .htaccess can i put below lines in my httpd.conf file? <FilesMatch "\.php$"> order deny,allow deny from all </FilesMatch> <Files index.php> order allow,deny allow from all </Files>
You can under the subdomain configuration, but it's still best you put in .htaccess. To put .htaccess, just create a file .htaccess at the folder you want to disable php access, then copy the lines into the file.