Forum Moderators: phranque

Message Too Old, No Replies

Redirecting Hosts Question

         

phpmaven

7:52 pm on Jun 13, 2005 (gmt 0)

10+ Year Member



I've had the following rewrite rule in place for some time:

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

I've had some recent situations where other domain names out of my control have been pointed at my ip. Do I really want to tell the world that www.spammy-web-site.com is actually www.mysite.com?

Should I test for those specific domains that I know belong to me and redirect them and issue 404s to any other domain? I haven't had any problem so far, but with all the hijacking talk going around these days, I'm a bit paranoid.

jdMorgan

1:59 am on Jun 14, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can either redirect only legitimate variations of your domain names to your main domain, or you can redirect all non-main-domain names to your main domain, but with a list of exceptions for the spammy domains.

Your choice would depend on which list is shorter, and whether you plan to add more legitimate domains in the future.

Jim