Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 06-27-2006, 08:40 AM   #1
Pure Evil
Confirmed User
 
Join Date: Mar 2006
Location: At the top of the food chain
Posts: 1,737
htaccess question

I usually pay people to design our sites and then pay someone else to manage them. but this time i am doing my own little personal project site by myself and there are a few things that i am not sure how to do. mainly i want to know how to protect some of the directories without blocking access to their contents. for example, lets say that i use the directory "/pics/" as the image directory and i want people to be able to view the pictures in it (linked from pages on the site) but i don't want people to be able to view a list of the contents of the folder by typing in "domian.com/pics/". how do i stop it from listing the directory's contents? I am pretty sure you can do it by adding a separate htaccess to that directory but i don't know what to put in that htaccess that keeps it from displaying the list of what it contains while still showing the pics. does that make sense?

final example:

typing in "domain.com/pics/image1.jpg" shows the picture image1.jpg

but

typing in "domain.com/pics/" = access denied or something similar



how do i do this?
__________________
I am the fourth Horseman.


If someone offers you an amazing hosting deal, call WEBAIR before you choose. You won't be sorry.
Pure Evil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 08:44 AM   #2
gooddomains
Too lazy to set a custom title
 
Join Date: Jul 2003
Location: Netherlands
Posts: 10,127
Options -Index
gooddomains is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:04 AM   #3
EdgeXXX
Confirmed User
 
EdgeXXX's Avatar
 
Join Date: Nov 2005
Location: Secretely plotting a hostile takeover
Posts: 5,816
Code:
IndexIgnore */*
Try adding that to your htaccess file, this should do the trick.
__________________
.
.
.
.

I have a sig
EdgeXXX is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:10 AM   #4
Pure Evil
Confirmed User
 
Join Date: Mar 2006
Location: At the top of the food chain
Posts: 1,737
Quote:
Originally Posted by gooddomains
Options -Index
tried that and everything came up as a 500 internal server error. are you fucking with me or is that supposed to work?
__________________
I am the fourth Horseman.


If someone offers you an amazing hosting deal, call WEBAIR before you choose. You won't be sorry.
Pure Evil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:13 AM   #5
Pure Evil
Confirmed User
 
Join Date: Mar 2006
Location: At the top of the food chain
Posts: 1,737
Quote:
Originally Posted by EdgeXXX
Code:
IndexIgnore */*
Try adding that to your htaccess file, this should do the trick.
yeah, that seems to have worked, now it shows the directory but it hides the contents of it. is there a way that i can just forward it to another url (instead of showing the directory page) or control what happens instead of just showing an empty directory?
__________________
I am the fourth Horseman.


If someone offers you an amazing hosting deal, call WEBAIR before you choose. You won't be sorry.
Pure Evil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:15 AM   #6
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
should be
Options -Indexes
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:17 AM   #7
Tom_PM
Porn Meister
 
Industry Role:
Join Date: Feb 2005
Posts: 16,443
Ok, if you turn of indexes, it generates an error when they hit it, so set custom error documents also

ErrorDocument 404 /index.html
ErrorDocument 403 /index.html
ErrorDocument 401 /index.html

or some other local file on the server.
__________________
43-922-863 Shut up and play your guitar.
Tom_PM is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:27 AM   #8
Pure Evil
Confirmed User
 
Join Date: Mar 2006
Location: At the top of the food chain
Posts: 1,737
Quote:
Originally Posted by PR_Tom
should be
Options -Indexes
good looking out tom, that worked. thanks
__________________
I am the fourth Horseman.


If someone offers you an amazing hosting deal, call WEBAIR before you choose. You won't be sorry.
Pure Evil is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 09:49 AM   #9
directfiesta
Too lazy to set a custom title
 
directfiesta's Avatar
 
Industry Role:
Join Date: Oct 2002
Location: Montreal, Quebec
Posts: 29,744
Quote:
Originally Posted by Pure Evil
good looking out tom, that worked. thanks
With a Control Panel like Cpanel, you wouldn't have to break your head ... one click, and it is done.
__________________
I know that Asspimple is stoopid ... As he says, it is a FACT !

But I can't figure out how he can breathe or type , at the same time ....
directfiesta is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 06-27-2006, 10:21 AM   #10
drjones
Confirmed User
 
Join Date: Oct 2005
Location: Charlotte, NC
Posts: 908
Also, if this is your server, and you have full access to it, you should really not use .htaccess at all, and disable it completely. Webmasters seem to love this file, but it really hurts performance. Anything you can put into an htaccess file you can put into your httpd.conf file instead. .htaccess really should only be used in shared hosting enviroments where you normally wouldnt have access to the httpd.conf.

<Directory /path/to/your/images>
Options -Indexes
</Directory>
__________________
ICQ: 284903372
drjones is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.