.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
ddantesAsked:
Who is Participating?
 
Dave BaldwinFixer of ProblemsCommented:
This page http://www.javascriptkit.com/howto/htaccess14.shtml says you're missing a '\' on each site.  Should  be:
#Block traffic from "bad" referrers
RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_REFERER} make-money-online\.7makemoneyonline\.com [NC,OR]
RewriteCond %{HTTP_REFERER} 245\.semalt\.com [NC,OR]
RewriteCond %{HTTP_REFERER} best-seo-solution\.com
RewriteRule .* - [F]

# redirect entire site to Site-1
RewriteRule ^(.*)$ http://www.mauitradewinds.com [R=301,L]

Open in new window

0
 
ddantesAuthor Commented:
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?
0
 
Dave BaldwinFixer of ProblemsCommented:
As far as I know you just need it once.
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
ddantesAuthor Commented:
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?
0
 
Dave BaldwinFixer of ProblemsCommented:
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'.
0
 
ddantesAuthor Commented:
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.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.