Welcome to WebmasterWorld Guest from 54.166.102.61

Forum Moderators: phranque

Hotlink Protection done but also http user agents googlebot allowed --

   
7:55 pm on Jan 30, 2013 (gmt 0)



Recently I have activated hotlink protection by inserting the below code in my .htaccess file.

RewriteCond %{HTTP_REFERER} !^http://www.MYDOMAIN.com/.*$   [NC]
RewriteCond %{HTTP_REFERER} !^http://www.MYDOMAIN.com$ [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot-Image [NC]
RewriteCond %{HTTP_USER_AGENT} !Mediapartners-Google [NC]
RewriteCond ${HTTP_USER_AGENT} !Mediapartners [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot-Mobile [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot-Video [NC]
RewriteCond ${HTTP_USER_AGENT} !Googlebot-News [NC]
RewriteCond %{HTTP_USER_AGENT} !msnbot [NC]
RewriteCond ${HTTP_USER_AGENT} !slurp [NC]
RewriteCond %{HTTP_USER_AGENT} !Bingbot [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.MYDOMAIN.com/ [R,NC]


Can anyone confirms whether it is cloaking or any violation of content guidelines according to google or not?

because here user and google bot gets two different page if they visit direct image link (http://www.MYDOMAIN.com/wp-content/uploads/2013/01/an-exapmle-photo.jpg)

user will be redirect to [MYDOMAIN.com...] but googlebot can crawls the image without any problem.


Please help..
12:28 am on Jan 31, 2013 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



Never mind cloaking. (Where does cloaking come in, anyway? As the rule is written, you're showing the named search engines the same content you'd show to a human visitor.) Have you any idea how many redundancies and unneccessary lines are in that code?

RewriteCond %{HTTP_REFERER} !^http://www.example.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.example.com$ [NC]


Line 1: "A followed by / and optionally more stuff"
Line 2: "A followed by nothing-- not even the / element which will always be present"

NC = case doesn't matter, so if you forge my domain name as referer you don't need to get it exactly right.

RewriteCond %{HTTP_USER_AGENT} !Googlebot [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot-Image [NC]
RewriteCond %{HTTP_USER_AGENT} !Mediapartners-Google [NC]
RewriteCond ${HTTP_USER_AGENT} !Mediapartners [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot-Mobile [NC]
RewriteCond %{HTTP_USER_AGENT} !Googlebot-Video [NC]
RewriteCond ${HTTP_USER_AGENT} !Googlebot-News [NC]


=

RewriteCond %{HTTP_USER_AGENT} !(Googlebot|Mediapartners)

RewriteCond ${HTTP_USER_AGENT} !slurp [NC]


Really? Not someone I'd make an exception for, but to each his own.

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ http://www.MYDOMAIN.com/ [R,NC] 


:: wanders off* sobbing brokenly ::


* Postcount suggests this is a perfectly safe action.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month