Forum Moderators: phranque
Here is a section of the .htaccess from the root directory of mysite.com.au (not the real name, nor badimages)
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite.com.au/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?google.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?maps.google.com.au/.*$ [NC]
RewriteRule .*\.(jpg¦jpeg¦png)$ [badimages.com...] [R,NC]
mysite.com.au is the primary site where the images are stored.
maps.google.com.au and the other google domains are some of the other sites I wish to allow to have hot links working on, but they don't seem to work and just show my warning image.
See example
[maps.google.com.au...]
Then select "Imperial Palace East Garden" to see if the picture shows.
I have reviewed the specific thread you mentioned and I have tried the suggestions there, but it has not resolved my problem.
Now the issue may relate to a specific issue with Google Maps, as I have no problems on most other sites, or it could be something more general.
A general google on inline linking will provide similar htaccess examples [google.com]
Redirecting to an alternative image is a BAD practice. The result is either you provide information to visitors unnecessarily, and even antagonize the visitor into looking for other weaknesses.
maps.google is NOT a www.
Your lines offered numerous errors of unescaped DOTS.
Mysites utilize different image types than yours.
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com\.au [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.google.com [NC]
RewriteCond %{HTTP_REFERER} !^http://maps\.google.com\.au [NC]
RewriteRule \.(jpg¦gif¦pdf¦ico)$ - [NC,F]
Please note; pipe characters require correction as they are broken by the forum format.
Your lines offered numerous errors of unescaped DOTS.RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com\.au [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.google.com [NC]
RewriteCond %{HTTP_REFERER} !^http://maps\.google.com\.au [NC]
RewriteRule \.(jpg¦gif¦pdf¦ico)$ - [NC,F]
As do my own. (edit time expired)
Corrected:
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mysite\.com\.au [NC]
RewriteCond %{HTTP_REFERER} !^http://www\.google\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://maps\.google\.com\.au [NC]
RewriteRule \.(jpg¦gif¦pdf¦ico)$ - [NC,F]
I would suggest re-typing the code using a plain-text editor (such as Windows NotePad), in case there are any 'hidden' characters or characters using alternate-encoding schemes not recognized by *nix/Apache.
Replacing images with a 'promotional image' is an acceptable practice, but of course you want it to work properly... :)
Jim