So you want to figure out how to disable any indexing that can occur on your web pages? Well, I hope to tell you, simply.
Have you ever gone to a website and typed in the wrong URL only to find a page with links to various folders? You know, one line says parent, another images, etc… I call this showing your underwear or letting your underwear hang out… Yeah! It’s embarrassing.
One day, many years ago, I learned the hard way that people could see what I had on my servers. They could browse all my file structures on my servers and copy whatever they wanted from my own server. They were able to see my “unmentionables.” It didn’t matter if I used a javascript to protect the images on a page, because they were not looking at the display page… They found my folder indexes.
It is sad but, truth. When people are offered easy access to files, they will take them. If they can get a glimpse of what you have on your servers, they can copy it.
There are a few ways that I have found that are easy fixes to hiding all my files and folders.
- You can put a blank file named index.html in each directory.
I don’t like this method because I have a lot of folders and it just becomes a pain. The first thing I do when I hit a blank page is try to figure out why. I usually will try to “fix” the URL thinking I must of mangled it.
- Go into your cPanel, click on “Index Manager” and then begin going through the list of folders and mark them as “No Index.”
What cPanel does with this process is write a line in a file called .htaccess. CPanel places that file in each directory (folder) on your server, but you have to go to each folder and click on it, click on its radio button to not have indexes and then repeat again with the next folder. So this is going down the right track, however, I have too many folders to do all this… haven’t you heard, “Time is money!” Do you have time to sit there and click on a radio button then click a link to go back up a level to go to the next? Hey, if you do, more power too you!
- Here is what I do. It is similar to option #1, but your viewer will get a different an error page instead of a blank. Create a file named .htaccess … It MUST have the [dot] in front of the word. The [dot] makes it invisible on your server. Inside that file type in only one line.
Options -Indexes
Then save this file and send it over to your server.
Using the third option has it’s benefits. By doing it this way all sub-directories of that directory will also get their directory listings turned off.
Now for the word of CAUTION!
There are many programs that access this .htaccess file regularly. Microsoft FrontPage Extensions, Blogs, Calendars, the list goes on, just to name a few. It is not advisable to change the .htaccess within the folders that are accessed by these programs. However, if you are determined and want to give it a try, then make sure you transfer the already existing .htaccess file from that folder to your computer… add the line to the top of that file, save and send it back to that same folder. More than likely though, these programs would probably overwrite that file anyway.
Good Luck!
More later…
Technorati Tags: Tips & Tricks!