Reply
Simple question about directory protection
Old 01-08-2008, 12:08 AM Simple question about directory protection
xanadu's Avatar
Skilled Talker

Posts: 83
Location: Swarthmore, PA
Hi all
Relatively simple question here. Is there any way I can protect a directory from prying eyes by visiting the directory directly (like www.mysite.com/files) while still maintaining functionality for all other things that refer to files within that directory via HTML or PHP?

I know it has to be some .htaccess thing...

Gracias
__________________
Time to Kill. Games to Play. arcadekill.com
xanadu is offline
Reply With Quote
View Public Profile Visit xanadu's homepage!
 
When You Register, These Ads Go Away!
     
Old 01-08-2008, 12:23 AM Re: Simple question about directory protection
jdfreelance's Avatar
Skilled Talker

Posts: 89
Name: Joseph Dickinson
You're right, .htaccess will do this. Google "protect directory .htaccess" .

Good luck
__________________
Freelance Web Development | Email // PHP/MYSQL/XHTML/CSS/FLASH/JAVASCRIPT/VBSCRIPT
jdfreelance is offline
Reply With Quote
View Public Profile
 
Old 01-08-2008, 01:00 AM Re: Simple question about directory protection
Moxxnixx's Avatar
33.33333333% Evil

Posts: 879
Name: Lance
Location: Florida
Alternatively, you can just throw a blank index.html into the directory.
__________________
Get your facts first, and then you can distort them as much as you please.
-Mark Twain

Add Webmaster-Talk to your Firefox Search Engine
Moxxnixx is offline
Reply With Quote
View Public Profile Visit Moxxnixx's homepage!
 
Old 01-08-2008, 01:38 AM Re: Simple question about directory protection
Skilled Talker

Posts: 71
Name: foong
To add a little to the .htaccess solution...

In order to disable a folder from listing it's content on browser, simply create a .htaccess file in the folder and
place in the following code :-

Options -Indexes

This instruct webserver to disable the directory listing if there is no default index file (i.e. index.htm, index.html etc.) present in the folder.
__________________
Foong
Over 100 Free Wordpress Themes for download
Dotservant.com professional web hosting since 2000
dotservant.com is offline
Reply With Quote
View Public Profile Visit dotservant.com's homepage!
 
Old 01-08-2008, 09:41 AM Re: Simple question about directory protection
xanadu's Avatar
Skilled Talker

Posts: 83
Location: Swarthmore, PA
Quote:
Originally Posted by Moxxnixx View Post
Alternatively, you can just throw a blank index.html into the directory.

Wow. It's so surprising how you can forget the most simplest of things. Thanks a ton everyone!
__________________
Time to Kill. Games to Play. arcadekill.com
xanadu is offline
Reply With Quote
View Public Profile Visit xanadu's homepage!
 
Reply     « Reply to Simple question about directory protection
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12914 seconds with 13 queries