Jump to content

Redirecting multiple domains to one website with php


Masca

Recommended Posts

Hi.

 

I have 9 domains, but only 1 hosting account/website (sadly I really can't justify the expense of a hosting account for each domain, unless someone can recommend a REALLY cheap place where I can simply host 8 additional .htaccess files!).  I would like all of the extra domains to be redirected to my main domain (just to give them a reason for existing really!) with 301 redirects for SEO reasons.  However, sadly my domain host only offers 302 redirects.

 

What effect would it have on search engines if I redirect all of my extra domains to a file such as www.mymaindomain.com/redirect.php which simply contains a 301 php header redirect and nothing else?  Would I still risk being penalised for duplicate content due to the fact the the redirect from my domain host initially results in an HTTP status code of 'HTTP/1.1 302 Found' before going to a status code of 'HTTP/1.1 301 Moved Permanently', or would search engines treat this as a valid 301 redirect?

 

Thank you!  Any advice is much appreciated.

Link to comment
Share on other sites

If you have DNS access then you can change the Name Server setting to your NS of your main server. If they are all hosted on the same server you can adjust the CNAME settings so that all 8 domains refer to your main domain something like:

 

www.main-domain.com A 10.0.0.1

www.main2-domain.com CNAME www.main-domain.com

www.main3-domain.com CNAME www.main-domain.com

..

 

Personally I use the latter to refer subdomains and I'm not entirely sure this also works for entire domains.

Link to comment
Share on other sites

Many thanks for your replies ignace and Daniel0.  My main domain is hosted on a shared server.  Do I still have an NS specific to my domain?  I've looked at my control panel, and the A record ends with 100, therefore suggesting that maybe it's used for more than one domain?  Sorry, I'm not very familiar with DNS.

 

Thanks again.

Link to comment
Share on other sites

Hi.  Sorry, I've been away from the PC for the last week.

 

No, the 8 other domains are registered elsewhere.  I don't currently have any hosting with them, and only pay for the domain registration renewals.  I might move my main domain and hosting later this summer (so all of them could then be together), but I would like a solution in the meantime if possible.

 

Thanks again for your continue help ignace.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.