homepage Welcome to WebmasterWorld Guest from 54.197.65.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library, Charter, Moderators: phranque

Webmaster General Forum

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



 
Msg#: 4540695 posted 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..

 

lucy24

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



 
Msg#: 4540695 posted 12:28 am on Jan 31, 2013 (gmt 0)

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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / WebmasterWorld / Webmaster General
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved