homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Spammer linking to our IP address with his domain name
Spammer linking to our IP address with his domain name

 6:14 am on Nov 5, 2006 (gmt 0)


Spammer registered .info domain name with same name as our .com domain and is linking to our domain's ip so now we have duplicate sites on one IP address ex: mydomain.com and mydomain.info

I have sent repeated emails to change his dns settings but he wont listen.

Any ideas how can prevent this? Can something be done through mod_rewrite on apache?

Thanks for your help.



 9:27 am on Nov 5, 2006 (gmt 0)

RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^www\.example\.com
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]

The first line is needed for very old browsers (or robots) who don't support virtual hosting, so they won't cause infinite redirects.


 9:30 am on Nov 5, 2006 (gmt 0)

I had this on a domain a while back and added the following to the .htaccess file:

Deny from baddomain.info

I'll leave it to the mod-rewrite experts to say if that is kosher, but it seemed to work for me.


 9:21 pm on Nov 5, 2006 (gmt 0)

Deny from baddomain.info

All that is going to to is deny any requests made FROM the baddomain.info server. But they don't have one, so this does nothing in this case.

bird's solution is the correct one. It will rewrite to your domain and avoid a duplicate-content penalty. Not only that, but you pull one over on the bad guy - YOU get the credit for his traffic.


 12:21 am on Nov 6, 2006 (gmt 0)

Hi bird,

Thanks for the rewrite code I am also using sub domains, would this code effect subdomains.

Could you please explain what does the second line do?



 12:30 am on Nov 6, 2006 (gmt 0)

Line by line:

# If requested hostname is NOT blank
RewriteCond %{HTTP_HOST} !^$
# AND requested hostname is NOT my canonical domain name
RewriteCond %{HTTP_HOST} !^www\.example\.com
# THEN redirect to requested page using canonical domain
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]


[edit] Formatting [/edit]

[edited by: jdMorgan at 12:46 am (utc) on Nov. 6, 2006]


 12:36 am on Nov 6, 2006 (gmt 0)

Thanks for that explanation.

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved