homepage Welcome to WebmasterWorld Guest from 107.21.186.38
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Pubcon Platinum Sponsor
Visit PubCon.com
Home / Forums Index / WebmasterWorld / Webmaster General
Forum Library : Charter : Moderators: phranque & physics

Webmaster General Forum

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




msg:4540697
 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




msg:4540782
 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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved