Forum Moderators: phranque
RewriteCond %{HTTP_REFERER} ^http://(www\.)?thereferrer\.com [NC]
RewriteRule .* - [F]
So how come the two parts do not work?
RewriteEngine On
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} ^http://(www\.)?thereferrer\.com [NC]
RewriteRule ^images/image\.png$ http://www.example.com/directory/images/new-image.png[L]
RewriteCond %{HTTP_REFERER} . -- means "and referrer is not blank".
This allows requests with blank referrer to view the site.
Are you saying this is not possible?
I am confused because the rewrite to set the URL to forbidden (whether I need the www or not)works with the referer set.
# Referer MUST begin with www.example.com (note leading anchor)
RewriteCond %{HTTP_REFERER} ^www\.example\.com
Are you saying this is not possible?
What we want is a rule that if a specific external domain visits that page
Using the following rewrite the page serves up the new background image - this works a treat, just what i'm looking for.
RewriteRule ^images/image\.png$ http://www.example.com/directory/images/new-image.png[L]
RewriteCond %{REQUEST_URI} /Landingpage/index\.html$ (tried with this)
You'll need to set the image properties (both the real and the replacement) so that it is not cached
RewriteRule ^images/image\.png$ /directory/images/new-image.png[L] I am at the same position -
^1.1.1.1 = no alternative image
!^1.1.1.1 = always alternative image
Whenever you say . quoting your htaccess you really mean \.
Whenever you say ^1.1.1.1 you really mean your own IP
Any difference if you also give a $ closing tag for the IP?
What do your logs say?