.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
LVL 1
ddantesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
Acronis True Image 2019 just released!

Create a reliable backup. Make sure you always have dependable copies of your data so you can restore your entire system or individual files.

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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Apache Web Server

From novice to tech pro — start learning today.