When people view images directly off my server (example url below), how can I have it so they are redirected to my homepage?
http://www.example.com/example.jpg
Printable View
When people view images directly off my server (example url below), how can I have it so they are redirected to my homepage?
http://www.example.com/example.jpg
Or just read this handy tutorial that i found via google: http://underscorebleach.net/jotsheet...taccess-apacheCode:RewriteEngine on
RewriteCond %{REQUEST_URI} ^/hotlinking-allowed
RewriteRule ^.*$ - [L]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png)$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !underscorebleach\.net [NC]
RewriteCond %{HTTP_REFERER} !bloglines\.com [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule (.*) /view_image.shtml?/$1
Thanks, I'll test it out tonight and see if it works.
That rule can be written like this. :)
Also, I would simply serve blank data rather than wasting server resources for the leeching traffic.Code:RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_FILENAME} \.(gif|jpe?g|png)$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !(underscorebleach\.net|bloglines\.com|google\.|search\?q\=cache) [NC]
RewriteRule !^/*hotlinking-allowed view_image.shtml?%{REQUEST_URI}
RewriteRule !^/*(hotlinking-allowed|blank.txt) blank.txt [L]