Help - Search - Members - Calendar
Full Version: protect folders on my website
4peeps.com Forums > General Hardware/Software > General Tech Talk
Hooch
I am thinking about putting a redirect or a warning page in all my folders on my webspace.
Is this the best way to keep people out of my stuff?

Just to clarify...
Say my site is 12345.com
Then ofcourse I would have 12345.com/images
Now what's the best way to keep people from typing 12345.com/images in thier browser
and seeing all my pics?

(I know I will not need this protection for any folder with index.php or index.html)

Thanks..Hooch
AceHigh
what web server?
Troll
Hooch!

If the server is Apache and you are allowed to upload a .htaccess file then:

Create a .htaccess file in your images directory with the contents of Options -Indexes

Then they'll get the 403 forbidden error instead of the file list.

If you run the server then add the -Indexes to Option line of your main <Directory> directive in httpd.conf for a global fix...

afro.gif
Hooch
Thanks Troll
I can upload .htaccess
Having the 403 Forbidden webpage is what I would like to have too.
But could you please elaborate on "with the contents of Options -Indexes"
Do you mean make the .htaccess file then just enter Options -Indexes at the top?


Ace, my webserver is MidPhase. I recommend to anyone btw.
Hooch
I did some research and found a good site full of info for .htaccess.

h**p://corz.org/serv/tricks/htaccess2.php
Troll
QUOTE(Hooch @ May 17 2006, 01:28 PM) *
Do you mean make the .htaccess file then just enter Options -Indexes at the top?

Yup thats it, when you cat .htaccess the first line in it is "Options -Indexes"

I like cooler access denied examples from corz.org (Good Find)
CODE

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^(.*)$ ../ [nc]



afro.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.