PHP disable on file wise

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
asela_05085
Forum Newbie
Posts: 16
Joined: Mon Aug 31, 2009 10:33 pm

PHP disable on file wise

Post by asela_05085 »

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
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: PHP disable on file wise

Post by Eric! »

What do you want to happen when some user tries to run one of these php files that is not supposed to be parsed? Are you using Apache?

If you want to redirect them you can change the .htaccess with redirect permanent.

If you want people to see these files as text you can change the .htaccess with addtype http://httpd.apache.org/docs/1.3/mod/mo ... ml#addtype
Post Reply