Forum Moderators: phranque

Message Too Old, No Replies

Proxies and .htaccess

Do proxy servers bypass htaccess?

         

obono

10:51 pm on May 26, 2005 (gmt 0)

10+ Year Member



Hello, I am rewriting image files via .htaccess, both thumbnails and large images. Although it seems simple to rewrite the folders where the images are (thumbnails/ and largeimages/) I see that my .htaccess does not work when looking at the pages via a proxy server.

The thumbnails do get rewritten but when clicking on them I can see the original large images as opposed to the new files.

Does anyone know if this is an unsurmountable problem? Thank you.

jdMorgan

4:22 am on May 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The simple answer is no, proxies don't 'bypass' your code. Proxies are nothing more than another computer between you and the original client. However, many proxies suppress the HTTP Referrer header. It is likely that your code allows blank referrers -- and it should, unless you want a lot of complaints from legitimate visitors whose ISPs' caching proxies also don't provide a referrer, such as all of AOL.

Access control based on the HTTP Referrer header is unreliable at best, as this case demonstrates. If you need better access control, then use a cookies-based authorization scheme; Set a cookie on your page that should be visited before displaying the images, then check the cookie --either in a script or in .htaccess-- and take action based on its presence and validity.

There are other solutions as well -- rotating the image directory/file names, for example. None are as simple as blocking or serving alternate images based on HTTP Referrer, but most of them work better.

Jim

obono

3:04 pm on May 27, 2005 (gmt 0)

10+ Year Member



Thank you, Jim!

Would you mind directing me to a source where I could learn more on "rotating the image directory/file names"? I think this solution will work great if I can rotate the file name where images have been placed, every hour or so.