Page 1 of 1

dont parse files in a directory

PostPosted: 20. January 2008 19:54
by feest
For a project I'm working on I need to provide the user with file downloads and this may be php files. Now I want to stop apache from parsing these files as php files (prevent apache from running the actual php code) and send them as a file download. (so the user will download a .php file instead of having a html file as output in the browser) how can i do this?

FOR EXAMPLE:

when you visit
http://www.2shared.com/

and you upload a php and you download it you will just download the php script. This is what i want...

PostPosted: 20. January 2008 20:29
by Scory
Simply disable PHP in httpd.conf - look for "php" in httpd.conf and delete the related lines.

PostPosted: 20. January 2008 21:51
by feest
but it should only be applied to files in 1 certain directory for all other files php should be allowed...

PostPosted: 21. January 2008 00:58
by Izzy
The easiest way is to create a .htaccess file in the directory you wish to disable PHP.

PostPosted: 21. January 2008 13:52
by feest
and when you upload a txt file on http://www.2shared.com you will download a .txt file instead of showing it in the browser (what usually would happen) how can this be done?