jscfan Posted October 23, 2003 Posted October 23, 2003 Got a quick question. Is there a way for me to disable my images folder from being viewed like a back door to all my files? I hope that makes sense... i.e. If you click on this url you can see most of my files and folders... http://www.jscfan.com/images/ well how do I disable this from happening? Like maybe show a "An Error or You're not allowed" page, I dunno something like that. I hope I made sense... thanks! Quote
cmuskett Posted October 23, 2003 Posted October 23, 2003 What I did was make an index page in the images folder. You can see my little message to people trying to grab my images that way here Daydreamer's Designs Quote
TCH-Sales Posted October 23, 2003 Posted October 23, 2003 What you need to do is login to your Cpanel, and click the Web Protect link under Site Management. From there you can turn off the indexing for that folder. Quote
Wilexa Posted October 23, 2003 Posted October 23, 2003 jscfan... There are three easy ways of doing this: 1. Via Web-protect (it will ask you for a password). (like Mitch suggested) 2. Just put in a small index.html page (like Charlotte suggested) and 3. My way! Via cPanel, select Index Manager. Click on the name of the folder to protect, then select "No Indexes". Then, users will get a 403 (forbidden) error. You can customize the error page if you like. Take a look: ** http://www.wilexa.com/lb/images/ ...dave Quote
jscfan Posted October 23, 2003 Author Posted October 23, 2003 thanks for all the replied guys, I did try the way cerealkeeler explained. But then I learned that any image posted on my forums or link to an image would also pop-up a login/password prompt... thanks to all of you now I know of 3 ways to fix my problem. I definitely liked your way Wilexa. That's exactly what I was looking for. Disable the browsing of my files, but still be able to post images on my forums or on my site without the pop prompt. btw, let me ask you this...say I create a folder (i.e "cars") and it would be something like this... http://www.jscfan.com/cars/ would I be the only one to know of that directory or can anyone else browse it without me telling anyone about it...just curious. thanks guys for all the help! Rock Sign Quote
Wilexa Posted October 23, 2003 Posted October 23, 2003 I am glad you liked my method. As for your question about a folder, you are the only one that knows a folder exists until... you create a public link to the directory itself or anything in it. By public, I mean a link that a spider might see. In your example you placed a "cars" folder under the public_html folder. If you have an index.html file, then the "cars" directory is hidden until you purposely put in a link. If there is no index.html file, then the world will see a list of all folders and files in your public_html directory when they typed in jscfan.com. If you have a link on your home page for example, to an image inside the "cars" folder, then humans might see that folder in their browser and investigate further. They might type in "jscfan.com/cars" to see what appears. A spider wouldn't bother. If you you don't publicly link to a directory or its contents, then people would just have to randomly guess names to see if there was a folder by that name. It's possible, but not probable. If you are running a car-oriented site, then someone might guess you have a "cars" directory, but if you named the folder "jhgasga" you would be pretty darn invisible! ...dave Quote
Frylock Posted October 24, 2003 Posted October 24, 2003 This may be somewhat mute now, but the easiest way to stop people from seeing the contents of any of your current folders, or folders you make in the future, is to just add this line to your .htaccess file in /public_html Options -Indexes Quote
DarqFlare Posted October 24, 2003 Posted October 24, 2003 I concur with Frylok. I have done the same thing to my .htaccess files and have had great results. But for good measure, I also include a PHP script that headers a redirection out to the home page of my site(s). Somewhat eliminates the needs for the line in the .htaccess files, but nonetheless, it's nicer than my error pages. Quote
TCH-Rob Posted October 25, 2003 Posted October 25, 2003 AH HA! oh wait, wrong forum. The CPanel method puts Options -Indexes in the .htaccess file for you. So if you are not comfortable editing the file you can use the click method to get it there. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.