Forum Moderators: phranque

Message Too Old, No Replies

hotlink whitelist for yahoo

         

mafe

9:32 pm on May 28, 2011 (gmt 0)

10+ Year Member



hello, i found in this thread:

[webmasterworld.com...]

a solution for add mail.live.com to the allowed sites in prevent hotlink with htaccess, i have follow that instruction and works, but how i could do to add mail.yahoo.com, or mail.yahoo.es, etc for my whitelist.

Thanks for your help!

lucy24

10:35 pm on May 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do you mean "mail.yahoo.anywhere"? That is, anything starting with "mail.yahoo" and then a third piece?

mail\.yahoo\.[a-z]+

should do it.

wilderness

10:44 pm on May 28, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yahoo changes their mail refers frequently. Perhaps as their users expand, perhaps other wise.

I've been using these two Yahoo's for some time, however they are for the leading sub-directories.

#ONLY allow Yahoo email refers from the US & Canada
RewriteCond %{HTTP_REFERER} !^http://(ca|us)\.f[0-9]{3}\.mail\.yahoo\.com [NC]
RewriteCond %{HTTP_REFERER} !^http://(ca|us)\.mc[0-9]{3}\.mail\.yahoo\.com [NC]

I've not monitored the email refers from non-North American countries and/or Yahoo (or others). (It's in my interest to deny access to non-North American countries)

You'll need to use something similar when the country code is on the trailing end.
You'll simply need to look at the leading and trailing character and numeral use and create your own string.
Using the following as a guide

#Chracter a thru z and two characters
[a-z]{2}

#Numerals o thru 9 and two numerals
[0-9]{2}

You may need to change the example of "two" characters or numerals that I've used in order to suit your own needs.