Greenguy's Board


Go Back   Greenguy's Board > Programming & Scripting
Register FAQ Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 2005-07-08, 01:59 PM   #1
seoguy
Rock stars ... is there anything they don't know?
 
Join Date: Nov 2004
Posts: 15
htaccess question

I want to block all 'bad' sites like for example fusker or user boards from steeling my images. Now, is it better to deny specific urls or is it better to allow specific urls.. I don't want to loose my google traffic from the image search...

So in the first case (block urls from steeling my images) my htaccess would look like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} .*.fusker* [NC,OR]
RewriteCond %{HTTP_REFERER} .*.lewww* [NC,OR]
RewriteCond %{HTTP_REFERER} .*.beyond8* [NC,OR]
RewriteCond %{HTTP_REFERER} .*.av999* [NC]
RewriteRule ^.+\.(jpg|jpeg|png|gif)$ - [NC,F,L]

and in order to allow specific urls my htaccess would look like this:

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?mydomain.com.*$ [NC]
RewriteCond %{HTTP_REFERER} !^.*msn\. [NC]
RewriteCond %{HTTP_REFERER} !^.*yahoo\. [NC]
RewriteCond %{HTTP_REFERER} !^.*altavista\. [NC]
RewriteCond %{HTTP_REFERER} !^.*google\. [NC]
RewriteCond %{HTTP_REFERER} !^.*webcrawler\. [NC]
RewriteRule ^.+\.(jpg|jpeg|png|gif)$ - [NC,F,L]

First of all, are there any mistakes in both of them? and which one would you prefer... I am confused
|shocking|
seoguy is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 03:13 PM.


Mark Read
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc