tbint Posted March 31, 2012 Share Posted March 31, 2012 I have a little issue with two different re-writes. I have a few sites I want to redirect the referers from. But I also wanted to hotlink the same sites from linking to images. I allowed the sites addons and primary domains to hotlink to images. But when I added a new condition and rule to redirect the referers it also added them to the allowed hotlinks. I have not figured out how to break the two different re-writes. Looking at it I can see why it would add them. Tried to put one before the other with no change. It does redirect the referers but it will not stop them from hot linking. Hot links I used cpanel to write to hatacces. The redirects I googled and altered till it worked with server. PHP Version 5.2.17 Could someone point me in the right direction. RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^MaMa\ CaSpEr [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^MaMa\ CyBer [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^ScoutJet* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^YandexBot* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Baiduspider* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Sosospider* [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^Mozilla/4\.76\ \[ru]\ \(X11;\ U;\ SunOS\?\ 5\.7\ sun4u\) [NC,OR] RewriteCond %{HTTP_USER_AGENT} ^ZmEu* RewriteRule .* - [F] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?linkfactory.dk.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?woeps.net.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?zfree.qc.to.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?m.zzsa.net.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?idc886.com.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?daivietpda.com.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?zzsa.net.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?txfzq.free.fr.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?freeidc.ca.*$ [NC,OR] RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?yandex.ru.*$ [NC] RewriteRule .* http://ttb62.125mb.com [R,L] RewriteCond %{HTTP_REFERER} !^http://litesitehost.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://litesitehost.com$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.litesitehost.com/.*$ [NC] RewriteCond %{HTTP_REFERER} !^http://www.litesitehost.com$ [NC] RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC] Quote Link to comment https://forums.phpfreaks.com/topic/260076-htaccess-hotlink-protection-and-http-referer-redirect-not-working-together/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.