View Full Version : restricting access to html files
wildplum
04-06-2006, 11:57 AM
I recently discovered that a spamer (or, more likely, several) has been using an old htm file in my storage space which contained an old FORM. This file is no longer used or referenced anywhere in my web space, but i never deleted it from my disc storage (it has been deleted now). the spamer was accessing it directly, www.wildplum.com/file.htm.
This got me thinking. There are many files I would like to have accessed only from my site, not directly.
So, my question is this: is there a way to prevent direct access of htm files but still allow access via from pages on my site (via buttons, links, etc.)?
jalal
04-07-2006, 12:43 PM
Sure. You can protect them through a technique called hotlink protection, try a google search for details.
Basically the server will check the Referer when a page is requested and refuse the request if it not coming from another page on the local site.
wildjokerdesign
04-07-2006, 02:57 PM
The pages you will find on Google may be a bit confuseing to you but it is the method you need to use in order to do what I think you want. Here is a test I set up to see if this is what you want.
TEST ONE (http://hahajoca.com/include/test2.html)
That should have thrown you a Forbidden message.
Also try to type the URL into your browser manually to access it.
http://hahajoca.com/include/test2.html
Ok now go to this page and try the link to it from my site.
http://hahajoca.com/test.html
wildjokerdesign
04-07-2006, 04:50 PM
I need to add to this some but do not have time. There is also a method by which you can "protect" a single file that would say be in your public root. Could be good for like a configuration file that you want other pages to be able to read but did not want them read directly. There really are so many approaches to this and when I have time I want to try and expand on this. I will keep the above pages active and add a link on them back to my main site where I will create a page the give more information.
vBulletin® v3.8.3, Copyright ©2000-2009, Jelsoft Enterprises Ltd.