Forum Moderators: phranque

Message Too Old, No Replies

Domain redirect x more domains

         

webstyler

6:56 am on Oct 14, 2006 (gmt 0)

10+ Year Member



Hi

We have to redirect www.mydomain.it to www.mydomain.org

In it domain the redict is more expensive that simple registration so we try to make redirection by ourself :)

so

we have a server where we have customer hosting, but we don't want assign space or plan to redirect domain

we can point 'all' domain '.it' to ip of this server..
in the root we can make a htaccess with a list to domain to be redirected

what do you think about?

thks

g1smd

9:51 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Point all domains at one server, and add the redirect code in the root folder.

That will do it.

Don't forget to redirect for both www and non-www too. The redirect must be a "301 redirect".

g1smd

11:45 pm on Oct 16, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^maindomain.com [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^other.net [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.other.net [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^whatever.co.uk [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.whatever.co.uk [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^mysite.org [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.mysite.org [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^otherone.us [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.otherone.us [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^mirrorsite.com [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]
RewriteCond %{HTTP_HOST} ^www.mirrorsite.com [NC]
RewriteRule ^(.*)$
http://www.maindomain.com/$1 [L,R=301]

encyclo

12:22 am on Oct 17, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You shouldn't even need to list the alternative domains - the following assumes that your main domain is "www.example.com":

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

The

[b]!^[/b]
means "is not www.example.com". Then as g1smd says above, just point all the deomains to the same folder.

Durham_e

10:30 pm on Oct 17, 2006 (gmt 0)

10+ Year Member



Thanks for the information above, I've always struggled to get 301 redirects sorted out.

Just to confirm the complete steps needed to 301 redirect one domain to another.

I have a domain B which I wish to redirect to Main Domain A.
Domain A is on shared hosting with its htaccess file in the www folder.

Domain B is with a separate domain registrar.

Step One.

1. I first change the htaccess file for Domain A to redirect Domain B as shown above posts?

Step Two

2. Then point Domain B to Domain A by changing the A record or IP addresses of domain B to the details for Domain A?
(Would using the URL redirect function also work?)

Thanks

Durham_e

12:34 am on Oct 30, 2006 (gmt 0)

10+ Year Member



Wrong

None of the steps above were necessary.

My problem was thinking a straight redirect from the registrar wasn't going to produce a 301.

Well it did so that was that!