PDA

View Full Version : How do I stop people browsing in my webspace directories?


Peter_Stanley
03-05-2004, 02:34
Any web desinger gurus out there this morning?

I've just updated my website and set Index.html as a holding page so that only people I give the correct link to can access my web pages.

However, it appears that its still possible to browse the directories, i.e. by guessing that I have a top level directory called "Images", someone can circumvent the Index page and access all my files.

Is there any way to stop this (commercial websites seem to be able to do it) or to password protect access?

I'm currently using the webspace provided by NTL, with domain forwarding for my domain.

Also, is there a simple way to stop the ntl link showing up in the status bar?

TIA.

TimmyB
03-05-2004, 03:02
The simple answer to the directory browsing issue is to put an index.html file in each directory.

If you had access to the web server configuration the directory browsing could be turned off - but you don't.

Matuka
03-05-2004, 10:39
The simple answer to the directory browsing issue is to put an index.html file in each directory.

If you had access to the web server configuration the directory browsing could be turned off - but you don't.

And what should it say?
Can you expand your suggestion please?

I am under the impression that you cannot prevent any browsing on NTL webspace.

Tricky
03-05-2004, 11:50
If you have an Index.html page in each directory the server would present the contents of this instead of showing you the directory content therefore browsing would be of no ben. unless you actually know the name of the file such as addy\images\myimage.jpg

Peter_Stanley
03-05-2004, 11:51
The simple answer to the directory browsing issue is to put an index.html file in each directory.

Thanks, that works a treat.

Matuka - with a Index.html file in each directory, configured to provide a holding page (in my case a blank page with an "under construction" logo), any attempt to look at the directory results in the holding page being displayed.

I suppose, alternatively, you could put a page that uses "onload" to kick the browser back to the home page.

TimmyB
03-05-2004, 13:37
And what should it say?
Can you expand your suggestion please?

I am under the impression that you cannot prevent any browsing on NTL webspace.

You are correct - you cannot prevent people browsing your website. The default bahaviour if you try to access a directory that doesn't have an index page - is that you are presented with a list of all files in that directory. Putting up an index page - which can contain anything - can even be blank, prevents anyone accessing the directory seeing a list of the contents - it doesn't prevent them accessing the files - but would have to know the names.

Hope that clarifies.

Matth
03-05-2004, 20:30
Yes, the index page in every directory is about the only solution - it can be either:
A blank page, a "no browsing my files" page, an "under construction" page, a mock-up of a 404 page ... I Like the idea of a fake "Index of" page.

More usefully, it could also be a refresh to your real index...
http://webdesign.about.com/cs/metatags/a/aa080300a.htm
For kicking someone from somewhere you don't want them, a delay of 0 is probably appropriate

Stuart
04-05-2004, 11:19
You may find that page needs to be called "index.html". Unix (or Linux) based web servers are usually case sensitive.

andygrif
04-05-2004, 14:13
Just a thought on what to do with the extra index.html files:

Why not make them duplicates of the original index file? That way no matter what directory your viewer looks at, they will only see the opening page, complete with the links and all.

Alternative is to use a direct script to point them back at the first index page.

SMHarman
04-05-2004, 14:38
Just a thought on what to do with the extra index.html files:

Why not make them duplicates of the original index file? That way no matter what directory your viewer looks at, they will only see the opening page, complete with the links and all.

Alternative is to use a direct script to point them back at the first index page.

You need to change the links to ensure that the graphics etc render properly and that the hyperlinks refer back down a level.

slimshady
04-05-2004, 15:41
alternatively use a page with a meta refresh tag to point back to your main website - save on all the extra re-coding to get graphics and links to work :) and means you only have to do this once - so if your pages changes you dont have to update this page :)

<HTML>
<META HTTP-EQUIV="REFRESH" CONTENT="0;url=http://www.mywebsite.com">
</HTML>

Simcut
17-05-2004, 13:51
hmm, do you mean when someone goes to www.blabla.co.uk/bla1/ (http://www.blabla.co.uk/bla1/) you dont want them to view the contents of /bla1/ where it lists all different types of files "directory listing" with a white background?

I've found out a way around it, if you want to know plz tell me and I'll get it sorted for ya :)