Forum Moderators: phranque
ErrorDocument 404 http://www.example.co.uk/error.html
AddType text/html .html
AddHandler server-parsed .html
RewriteEngine On
RewriteCond %{HTTP_HOST}!^www.
RewriteRule (.*) [%{HTTP_HOST}...] [R=301,L]
RewriteCond %{HTTP_REFERER}!^http://(.+\.)?example\.co\.uk(/)?.*$ [NC]
RewriteCond %{HTTP_REFERER}!^$
RewriteRule .*\.(gif¦jpg¦pdf)$ http://www.example.co.uk/nohotlink.html [R,NC]
However I need to fix it so that http://www.example.co.uk/images/banner.jpg can be hotlinked.
Please would you advise on the fix.
RewriteCond %{HTTP_REFERER} .
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?example\.co\.uk [NC]
[i]RewriteCond %{REQUEST_URI} !^/images/banner\.jpg$[/i]
RewriteRule \.(gif¦jpg¦pdf)$ http://www.example.co.uk/nohotlink.html [NC,R=302,L]
Replace the broken pipe "¦" characters above with solid pipe characters before use; posting on this forum modifies the pipe characters.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim