PowWeb Forums - The Perfect Community for the Perfect Host  

Register now to interact with over 11,000 members! Registered users have Posting Privileges, free access to Private Messaging, Email Notifications and more.

Go Back   PowWeb Community Forums > Web Site Design > HTML/CSS/Javascript
User Name
Password
Register FAQ Members List Search Today's Posts Mark Forums Read

Closed Thread
 
Thread Tools Search this Thread
Old 9-6-02, 12:10 PM   #1
Seafire1
 
Posts: n/a
Unhappy need to know how to prevent directory browsing

Can anyone help me figure out how to block or prevent in anyway the browsing of the folders as per when you dont have a page up and running people can see your folders.

When you type someting similer eg: "http://www.yourdomain.com/images/ " you can see images in that folder.

Well i want to prevent that to happend is there a way of doing so.

Without protecting all pages only directory browsing.

Thanks a bunch.
 
Old 9-6-02, 12:29 PM   #2
stevel
XPW
 
stevel's Avatar
 
Join Date: Jun 2002
Location: New Hampshire, USA
Posts: 9,464
Reputation: 265
Easiest way is to put an index.html page in the images folder. It can be a redirect to your home page, or just a "no browsing please" page.
__________________
Steve
stevel is offline  
Old 9-6-02, 12:31 PM   #3
muijefr
home boy
 
muijefr's Avatar
 
Join Date: Jan 2002
Location: Vancouver, WAUSA!
Posts: 1,841
Reputation: -12
place an index.htm document




in the folder you want protected that will redirect the surfer to your home page with an appropriate message.
Example:
www.the-ebiz.net/forum

you will have time to right click and save the source if you please



Last edited by muijefr : 9-6-02 at 12:33 PM.
muijefr is offline  
Old 9-6-02, 01:17 PM   #4
Ddr
 
Ddr's Avatar
 
Join Date: Jan 2002
Posts: 949
Reputation: 5
another solution

You can add any of these lines to your .htaccess files, too. The directive will affect the Folder that your .htaccess is in and all folders below it.
-------------------------
Options -Indexes

(this prevents listing of directories)
-------------------------
Options +Indexes

(this allows listing of directories, possibly useful to override an .htaccess directive stopping listing for all directories in case you want to allow it for particular ones)
-------------------------
IndexIgnore *

(will prevent listing of all files, the "*" is a wildcard)
-------------------------
IndexIgnore *.gif *.jpg

(will prevent listing of any files with .gif or .jpg extensions, but will allow other listings)
-------------------------


Hope this proves useful.

Dale

Last edited by Ddr : 9-6-02 at 01:19 PM.
Ddr is offline  
Old 9-21-02, 12:42 AM   #5
jcoates
 
Posts: n/a
Hey guys this is the same thing that I need to do. Can you be a little more specific, in terms of how to do it. :


Thanx

Last edited by jcoates : 10-7-02 at 08:59 AM.
 
Old 9-21-02, 08:28 AM   #6
Ddr
 
Ddr's Avatar
 
Join Date: Jan 2002
Posts: 949
Reputation: 5
hi jcoates

More specific? What is it you dont know how to do?

If you dont know how to use FTP to put an index.htm file in a directory you might go to http://help.powweb.com and read up on it there.

If you dont know how to create an index.htm (or .html) file, then you really need to do some homework.

If you want to use .htaccess to disallow directory browsing, the lines to add to your .htaccess are right here in the thread. They couldn't be more specific. Just copy them into your .htaccess file. If you dont know what an .htaccess file is or how to use it, then you should go to http://help.powweb.com and read the tutorial on password protection with .htaccess and see if that answers your questions. There are multiple threads throughout these forums from people who could not make .htaccess for password protection work, and the solutions they found. Mostly it is a result of not following the directions in the tutorial or just not typing correctly.

I suggest that you try it, read the tutorials, do a search in these Forums, read and learn from the mistakes others have made, and if you are still having a problem, come on back. We will be happy to help you trouble shoot your problems.

I hope that was specific enough for you.

Dale
Ddr is offline  
Old 9-21-02, 01:11 PM   #7
jcoates
 
Posts: n/a
It looks like the .htaccess file is the easiest way. I use FP2000 and can't find the .htaccess file.
 
Old 9-21-02, 01:24 PM   #8
NMS
Moderator
 
NMS's Avatar
 
Join Date: Apr 2002
Location: Malta - Europe
Posts: 7,108
Reputation: 125
Cool

If you are using FP then place a file in each directory you have. Name this file index.html and its contens should be: wrong page or not authorised. Fp will upload it automatically hopefully.
NMS is offline  
Old 9-21-02, 01:53 PM   #9
jcoates
 
Posts: n/a
Thanx alot guys.

The index.htm worked perfectly.
 
Old 9-21-02, 02:05 PM   #10
Binar
 
Posts: n/a
You need to be familiar with <htaccess> there are plenty of
tutorials on the web that cover your exact requirements

I think one url is http://www.javascriptkit.com/
 
Old 9-21-02, 08:49 PM   #11
Ddr
 
Ddr's Avatar
 
Join Date: Jan 2002
Posts: 949
Reputation: 5
FrontPage and .htaccess

Unfortunately, for the casual web programmer who uses FrontPage to managed their site, custom .htaccess files are a real problem. FP likes to overwrite them in it's on microsofty way, rendering them useless.

While I am sure that custom .htacess can be done somehow in conjunction with FP, I dont use FP, so cant be of any help there. There is a section in this Forum for FP help. Possibly someone there knows what has to be done.


Dale
Ddr is offline  
Old 10-7-02, 02:56 AM   #12
Browsehosts
 
Posts: n/a
i think index.html is better than index.htm, although maybe you should just put both in just to be sure.
 
Old 10-7-02, 01:12 PM   #13
muijefr
home boy
 
muijefr's Avatar
 
Join Date: Jan 2002
Location: Vancouver, WAUSA!
Posts: 1,841
Reputation: -12
Question Browsehosts



Quote:
i think index.html is better than index.htm, although maybe you should just put both in just to be sure.
That's an interesting remark. Why do you think index.html is better than index.htm and why would you put both in just to be sure. I know why you need not put both in but why would you use html rather than htm.
muijefr is offline  
Old 10-7-02, 01:38 PM   #14
Browsehosts
 
Posts: n/a
well me personally, i always put .html , because it is more natural for a browser than .htm
 
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 08:49 AM.


Contents ©PowWeb, Inc. ~ vBulletin, Copyright © 2000-2007 Jelsoft Enterprises Limited.