PDA

View Full Version : need to know how to prevent directory browsing


Seafire1
9-6-02, 11:10 AM
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.

stevel
9-6-02, 11:29 AM
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.

muijefr
9-6-02, 11:31 AM
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

Ddr
9-6-02, 12:17 PM
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

jcoates
9-20-02, 11:42 PM
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.:confused: :


Thanx

Ddr
9-21-02, 07:28 AM
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

jcoates
9-21-02, 12:11 PM
It looks like the .htaccess file is the easiest way. I use FP2000 and can't find the .htaccess file.

NMS
9-21-02, 12:24 PM
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.

jcoates
9-21-02, 12:53 PM
Thanx alot guys.

The index.htm worked perfectly.

Binar
9-21-02, 01:05 PM
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/

Ddr
9-21-02, 07:49 PM
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

Browsehosts
10-7-02, 01:56 AM
i think index.html is better than index.htm, although maybe you should just put both in just to be sure.

muijefr
10-7-02, 12:12 PM
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.

Browsehosts
10-7-02, 12:38 PM
well me personally, i always put .html , because it is more natural for a browser than .htm