Welcome to WebmasterWorld Guest from 23.22.46.195

Forum Moderators: Ocean10000 & incrediBILL & phranque

How to block the visitor from downloading my php files

   
5:05 pm on May 30, 2008 (gmt 0)

5+ Year Member



I have put all my php files in a directory. But If the vistor get the name of the php files, they can download all of them. I want to block the visitor from downloading all the php files. What should I do to make it?

Thanks in advance!

7:52 pm on May 30, 2008 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



In the php-files directory, add this to your .htaccess file, or create an new .htaccess file in that directory with the following lines:

Order Allow,Deny
Deny from all

This directory will then become inaccessible via HTTP. You will still be able to invoke scripts by "including" them on your pages, but no direct HTTP requests will be allowed.

Jim

12:28 pm on May 31, 2008 (gmt 0)

5+ Year Member



thanks. very helpful
10:09 pm on May 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What do you mean by 'downloading the files'? Surely they can't download the actual php scripts? They can only download what the scripts generate on the server.

[edited by: Patrick_Taylor at 10:15 pm (utc) on May 31, 2008]

10:45 pm on May 31, 2008 (gmt 0)

5+ Year Member



I have a similar concern.

I have all my .html, .pl, and data files in the domain directory and its sub-directories. Anyone can find out the filenames and sub-directories pathnames of all these by viewing the source of the browser display.

Can people view or copy my data files and script files?

1:41 am on Jun 1, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Worse than that, they may be able to "run" small parts of your scripts and inject malicious values into some of your variables.

Protect the folder form access and from indexing.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month