![]() |
htaccess/hotlinking for WP
Was hoping to find an easy way to hotlink protect my blog(s) from a few domains..with the ability to add more if needed and then in turn sending that traffic to a url of my choice.
Thanks in advance. |
There are two ways to do it.
1) Block everything unless you specifically allow it -- this probably doesn't play well with the nature of blogs, but, the code would be: Code:
RewriteEngine on Code:
RewriteEngine on Code:
RewriteEngine on |
Does this always work , I am getting a ton of traffic from asktiava which I want to redirect , I have this code in my htaccess:
Code:
RewriteEngine on |
Thanks for the reply CD - so to block out one domain (at the time being) Coudl I set up htaccess like this?
Code:
RewriteEngine on |
Mr Spock, Im not a code guru or anything but it appears with your example, you're adding the http and the www twice? maybe remove the "http://www." from the domain string and see if that works? Perhaps only use the "asktiava.com/search/" part.
|
Yes NY Jester, that snippet would work for banning 1 domain.
Code:
RewriteCond %(HTTP_REFERER) ^http(s)?://(www\.)?http://www.asktiava.com/search/.$[NC,OR] as NY Jester says: Code:
RewriteCond %(HTTP_REFERER) ^http(s)?://(www\.)?asktiava.com/search/[NC,OR] |
Quote:
|
Are you sure your .htaccess is being parsed? what is a url on that other site that is supposed to redirect based on your rule?
can you give me the query you use from the remote site? perhaps something in the url or the way they pass it to your site is erasing the referrer. |
This is the search query on asktiava.com:
http://www.asktiava.com/search/?p=10...awna+lenee&nc= If I click on this link to my site it doesn't redirect like it should. http://www.myfree-porn.com/free-gall...-ibp/free.html Here is the contents of my htaccess: Code:
AddType php-cgi .html .htm |
do you have any .htaccess files down below the one in your top directory?
if so, do they contain: RewriteOptions inherit in them? If they don't, they replace the existing rewrite rules also, your rules that end with .$ won't match much of anything -- you need them to either be .*$ or remove the .$ at the end. |
I changed the htaccess using the coding you gave Nyjester as follows
Code:
RewriteEngine on What do I need to change to direct it to http://avoidhomeforeclosureblog.com |
All times are GMT -4. The time now is 06:45 PM. |
Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© Greenguy Marketing Inc