Forum Moderators: phranque
Are there any disadvantages to doing it this way? What happens when users go to your page from Google or look at your page in Google's cache?
Thanks for any thoughts
==============
<quote>
there is an easier way to avoid hotlinking without using .htaccess files.
your domain name will normally be mapped to a directory (/web or /htdocs or something like that) within your hosting account, and you will normally place images in a subdirectory of this, ie, /web/images/. you will link to the images with <img src="images/filename.jpg" ...
create an images directory at the same level as your /web or /htdocs directory. change your image links to <img src="../images/filename.jpg .... etc. there is no direct web access to this directory so nobody can hotlink. only your web pages and scripts can access the images directory. voila! no more hotlinking and no .htaccess files!
you should do the same with any sensitive files or information that you want to prevent access to.
</quote>
My objections to crazyfool´s statement as given in this thread you are referring to still stand. You cannot refer to a directory below the document root from within the URI namespace unless such a directory is mapped to the URI namespace. In any case it would not be below the root of the URI namespace since by definition that is impossible.
You could use a script to access the images but then that script would need to reside within the URI namespace. It would be up to the script to do the access control.
Andreas
As for Andreas's comments. Sure, that would be nice. It was, indeed, hard to find the old thread. I had remembered it but spent an hour searching myself.
And then I couldn't find a way to use the forum to quote the source and the old thread had been closed, so I couldn't just update on the thread. I should have mentioned the thread number. My oversight.
You've brought up a very good point, though, about the site's inadequacies. This forum is wonderfully full of great info, but the search functon is pitiful. It often returns no results where I know there should be some. Maybe it doesn't search on the messages, just the titles? Plus, it needs a good quote function. If it has one, I couldn't find it.
Andreas