dont parse files in a directory

Problems with the Linux version of XAMPP, questions, comments, and anything related.

dont parse files in a directory

Postby feest » 20. January 2008 19:54

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...
feest
 
Posts: 35
Joined: 17. April 2006 13:23

Postby Scory » 20. January 2008 20:29

Simply disable PHP in httpd.conf - look for "php" in httpd.conf and delete the related lines.
Scory
 

Postby feest » 20. January 2008 21:51

but it should only be applied to files in 1 certain directory for all other files php should be allowed...
feest
 
Posts: 35
Joined: 17. April 2006 13:23

Postby Izzy » 21. January 2008 00:58

The easiest way is to create a .htaccess file in the directory you wish to disable PHP.
Last edited by Izzy on 28. January 2008 00:34, edited 1 time in total.
Izzy
 
Posts: 3344
Joined: 25. April 2006 17:06

Postby feest » 21. January 2008 13:52

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?
feest
 
Posts: 35
Joined: 17. April 2006 13:23


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 7 guests