Link to home
Start Free TrialLog in
Avatar of ddantes
ddantesFlag for United States of America

asked on

.htaccess not performing

One of my domains (mauivacationrental.com) is redirected to another domain (www.mauitradewinds.com) using .htaccess, and this is working.  However, before the redirection is executed, there is code to block certain referrers.  One of the referrers is still accessing the site and being redirected.  That referrer is:
http://best-seo-offer.com/try.php?u=http://mauivacationrental.com   
Please advise how to block this referrer.htaccess.txt
ASKER CERTIFIED SOLUTION
Avatar of Dave Baldwin
Dave Baldwin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ddantes

ASKER

Thank you for making it easy!    May I ask -- is it sufficient to declare RewriteEngine On RewriteBase /    once,  at the top of the file, or must it appear in each code section which relies upon that function?
As far as I know you just need it once.
Avatar of ddantes

ASKER

Hello Again:  I'm still getting visitors from the blocked domain.   The referrer is:
http://best-seo-offer.com/try.php?u=http://mauivacationrental.com   

Per your advice, the following code is included in .htaccess:
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_REFERER} best-seo-offer\.com

Since there are several blocked domains, perhaps each line of code should have "[NC,OR]", except the last referrer in the list?
I don't know about the "[NC,OR]" but that seems to be right.  Also... double check your list.  The list you posted has 'best-seo-solution\.com', not 'best-seo-offer\.com'.
Avatar of ddantes

ASKER

Thanks Dave.  The blocked referrer list has both versions of best-seo, and I should have posted the one which relates to the most recent visit.  I'll see if the "[NC,OR]" will put a stop to these.