문제

There is a malicious site which has replaced mine in Google search results. I checked the headers and this malicious domain is sending traffic directly to our servers.

I'd like to rewrite Apache's directives so that there is a 301 redirecting any traffic from the malicious site to our site in order to get Google to give me back my listing.

Does anyone know how to write this directive? I hardly know anything about this stuff but I think it involves RewriteEngine. Do I update it in .htaccess?

UPDATE FOR CLARITY: When someone searches for my company name in Google the malicious domain is the top result. Click on it and it immediately goes directly to our server - it's not a redirect, it's a straight 200 to my IP (but in their domain). Makes me think they're pointing their DNS to my IP. Is there a way to write a directive that would execute a 301 redirect to my domain whenever traffic was coming from the malicious domain?

RESOLVED: I had help figuring this out... here's the fix. I put this at the top of my {site.com}.conf file:

<VirtualHost *:80>
      RedirectMatch permanent ^/(.*) http://www.{site}.com/$1
</VirtualHost>
도움이 되었습니까?

해결책 2

I had help figuring this out... here's the fix. I put this at the top of my {site.com}.conf file:

<VirtualHost *:80>
   RedirectMatch permanent ^/(.*) http://www.{site}.com/$1
</VirtualHost>

다른 팁

You say this:

I checked the headers and this malicious domain is sending traffic directly to our servers.

Then this:

I'd like to rewrite Apache's directives so that there is a 301 redirecting any traffic from the malicious site to our site in order to get Google to give me back my listing.

So it’s already sending traffic to your servers but you want to do what exactly? Apache rewrite rules only work on servers you have control of. If someone poisoned your listings on Google & now gets traffic, your access to your own servers won’t change that.

test the host header and redirect.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.)?yourhost.com$
RewriteRule . http://www.yourhost.com%{REQUEST_URI} [R=301]
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top