PDA

View Full Version : Directory Browsing


spleen1015
2-12-03, 05:38 PM
If you go to www.spleen1015.com/naba/Leaguesite/ you can see the files that are in that directory. I don't want that to happen. Is there any possible why to prevent this? I have been told there is.

alphadesk
2-12-03, 05:42 PM
Put a blank index.html page in that directory.... or maybe with a message.

Or you can do it with .htaccess
http://www.javascriptkit.com/howto/htaccess11.shtml

spleen1015
2-12-03, 05:46 PM
That works for me, I guess.

Pauly
2-12-03, 06:08 PM
Hey All,

I added a index.htm, like what Alphadesk mentioned above. Then I added a META refresh tag the sends you back my main page after five seconds. You can set the time limit by changing the 5 to what ever number you want. I also made this page look like my web site, instead of getting a bright white page. I have used this item for my 404 error messages.

<META HTTP-EQUIV="refresh" content="5;URL=http://www.dropthedrum.com/">

See it in action: www.dropthedrum.com\images


Pauly
www.dropthedrum.com




Try this:

<html>
<head>
<title>ACCESS DENIED</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#151B8D" text="#3BB9FF">
<center>
<table width="600" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="600" height="80" valign="top"><a href="http://www.dropthedrum.com/"><img src="/images/DTRCOMSTATIC.gif" name="DTRCOMSTATIC" border="0"></a><img src="/images/BlueBrown2.gif" width="682" height="15"></td>
</tr>
</table>
</center>
<div id=div300 style="position: absolute; left:5px; top:100px;; width: 839px; height: 10px">
<a href="http://www.dropthedrum.com/Services.html"><img src="/images/Services15frames.gif" border="0"></a><a href="http://www.dropthedrum.com/COA.html"><img src="/images/COA20Frame.gif" border="0"></a><a href="http://www.dropthedrum.com/Download.asp"><img src="/images/DOWNLOAD.gif" border="0"></a><a href="http://www.dropthedrum.com/Links.html"><img src="/images/Links1.gif" border="0"></a><a href="http://www.dropthedrum.com/MeetPauly.html"><img src="/images/MeetPauly.gif" border="0"></a>
</div>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META NAME="ROBOTS" CONTENT="NOINDEX">
<META NAME="ROBOTS" CONTENT="NOFOLLOW">
<META HTTP-EQUIV="refresh" content="5;URL=http://www.dropthedrum.com/">
<br><br><br><br>
<br>
<center>
<h1>403 (Forbidden)</h1>
<h1>ACCESS DENIED</h1>

<br>
<h1>Sorry,</h1>
<h1>You are not allowed in here.</h1>
</center>
<center>
<h1>Hang On!!! I'll escort you back to my main page.</h1>
</center>
<br><br><br>
</center>
</body>
</html>

Jade Dragon
2-12-03, 06:29 PM
If you want to use .htaccess

create a text file using notepad.

Options -indexes

type in that line and upload with FTP program to root /htdocs/ directory. (do not use .htaccess if you are using FrontPage)

make sure the file says ".htacess" and not ".htaccess.txt"

:)

JD

PatMan
2-12-03, 09:13 PM
just to piggyback on JD's comment, if you disallow indexing via a .htaccess directive, the user will get the default 403 page. To fix that you'll want to add something like the following to your .htaccess:

ErrorDocument 403 /403.html
ErrorDocument 404 /404.html

etc, etc, etc - you can also get clever an send all your errors to a php error handler, but I'll leave that as an exercise for the reader :D

Patrick