Forum Moderators: phranque
My site is stored on two different servers at two different companies. One server stores all my images, the other all my files.
After playing around with .htaccess I have discovered that the server hosting the images does not accept mod_rewrite. So, after some searching I found this code :
SetEnvIfNoCase Referer "^http://(www\.)?mydomain\.co\.uk\" locally_linked
SetEnvIf Referer "^$" locally_linked
<FilesMatch "\.(gif¦png¦jpe?g)$">
Order Allow,Deny
Allow from env=locally_linked
</FilesMatch>
(the ¦ is actually the solid pipe character)
Now I set this up so that mydomain.co.uk is the server that contains the files. My understanding of this is that if the referrer is not mydomain.co.uk then forbid access. This then stops people typing in the URL of any the images directly on the image server.
I thought it was working great until I tried to access an image from the file server (mydomain.co.uk), but access is forbidden from that too. Have I done something wrong? Does anyone know how I can also exclude a directory from the ban - for "shared" images I might want people to have access to?
Thanks to anyone who can help.
Try:
SetEnvIfNoCase Referer "^http://(www\.)?mydomain\.co\.[b]uk"[/b] locally_linked
Jim