homepage Welcome to WebmasterWorld Guest from 23.20.149.27
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Subscribe and Support WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Making a directory unaccessable other than from the server itself
A file hosting website doesn't want direct viewing of files, only downloads
uplius




msg:4066782
 2:39 pm on Jan 24, 2010 (gmt 0)

Hi there, I have the file hosting website which I just started. I have it set up that there is a directory called "Files" where all the files are stored, then in a seperate directory there is "download" which contains the files needed to download a file from the files directory. So if you go to foo.com/dl/filename.jpg, it will download the file (using an htaccess shortcut, actual route is foo.com/download/index.php?file=filename.jpg). However, if you accessed this file directly by going to the source of the file, foo.com/files/filename.jpg, then you will be viewing the image. The more primary concern is the viewing of html or php files, I don't want a website hosting site to implant itself! How do I prevent the access of these files ONLY by my download directory, but not in the files directory itself? Thanks!

 

jdMorgan




msg:4066785
 3:02 pm on Jan 24, 2010 (gmt 0)

See the documentation for Apache [httpd.apache.org] mod_access and Apache core appropriate to your server version number.

Put a .htaccess file in the /files subdirectory containing

Options -Indexes
#
Order Deny,Allow
Deny from all

Jim

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved