I was speaking to John Lessnau via email yesterday about the WordPress plugin for LinkXL (which I am planning on reviewing soon). The site scans your website and looks for keywords etc but it wasn’t able to do it.
John then pointed to my plugin directory and said that one of the many plugins installed was conflicting with theirs. I pointed out that I didn’t actually have that many plugins installed and had just tried a few out (ie. most were not activated) but what did concern me was that everyone could see my plugins. I am not an expert with htaccess but I’m familar with most basic techniques. I’ve just been lazy and taken the time to hide my folders from the general public. Thankfully it is painfully easy to do this!
How to stop people viewing files in your directories
By default, everyone can see the files you upload to a directory (unless there’s an index file). Commonly, most webmasters forget to protect their images and banners folders. I cannot criticize anyone for this as I am quite lazy in this regard too and there really is no excuse as it’s incredibly easy to stop people viewing files in your directory.
To protect a directory from listing files all you need to do is upload an .htaccess file to the directory with the following :
IndexIgnore *
The * is a wildcard, a catch all that stops all files from being listed. You could of course only only ban certain file types. For example, if you wanted to stop your word documents but were happy with the graphic files being listed you could use :
IndexIgnore *.doc
Personally, I prefer to put all information in the root .htaccess file instead of uploading seperate .htaccess files to several directories. To do this all you need to do is add the folder path, relative to where your .htaccess file is.
So for example, if I wanted to stop people viewing the plugins and themes folder in this blog I would add this to my root .htaccess file :
IndexIgnore /wp-content/plugins/*
IndexIgnore /wp-content/themes/*
Should you be concerned about directory files being listed
Most of the time there isn’t any real harm in leaving directories open to the public but it’s probably still a good habit to protect your images, banner and video folders. At the very least it will reduce your bandwidth but it will also stop people viewing files directly outside of your main site.
For example, say you post a funny video on your site and it is bringing you a lot of traffic. If the directory the video is saved in can be viewed by everyone then the video can be viewed directly ie. people can see the non-embedded video directly which means less advertisements are being displayed to them which in turns means less money for you!
Also, goes without saying that if you have important private documents on your website then restricting them from public view is a must.
I encourage you to try this out on your site if you haven’t used this before. It’s very straight forward but should you be unsure about any of this please let me know and I’ll do my best to help
Thanks,
Kevin










