How to redirect one domain to another without affecting your other DNS records ?

Suppose you are having a domain name ( www.oldwebsite.com ) and now you redirect all the traffic coming to the old website to the new website. If you will simply forward the domain then the DNS records will get messed up and MX records won't be preserved. While the alternative way is to make it happen programmatically. We can use following ways to achieve the desired result : 1. PHP script :

There are other ways as well which will be updated shortly.

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.

Moments