Thread: htaccess help
View Single Post
Old 2006-11-22, 07:46 AM   #4
jayeff
Just because I don't care doesn't mean I don't understand!
 
jayeff's Avatar
 
Join Date: Sep 2006
Posts: 95
Send a message via ICQ to jayeff
This does the same, but it allows some of the image searches to show results and includes a response to non-image hotlinking:
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} .*jpg$|.*gif$|.*png$ [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://([^@\/]+@)?([a-z0-9-]+\.)*yourdomain.com(:80)*(/.*)* [NC]
RewriteCond %{HTTP_REFERER} !google\. [NC]
RewriteCond %{HTTP_REFERER} !msn\. [NC]
RewriteCond %{HTTP_REFERER} !yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !search\?q=cache [NC]
RewriteRule (.*) /hotlink.png [R]
RewriteCond %{REQUEST_FILENAME} !^.*jpg [NC]
RewriteCond %{REQUEST_FILENAME} !^.*gif [NC]
RewriteCond %{REQUEST_FILENAME} !^.*png [NC]
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://([^@\/]+@)?([a-z0-9-]+\.)*yourdomain.com(:80)*(/.*)* [NC]
RewriteRule (.*) /somepage.php [R,L]
hotlink.png and somepage.php are assumed to be in the root directory in this example and it also intended to allow type-ins, javascript access etc. You can modify/remove the relevant lines as you wish...
jayeff is offline   Reply With Quote