Recently, I was in need of moving a site to a new domain. I did not want to just delete/remove the content from the old domain, leaving it returning a 404 error, so I created a redirect to the new site so users would automatically be sent to the new domain.
By using PHP’s header function you can automatically redirect your users to the new domain/page.
Note that the header function goes within the <?php ?> tags of a PHP file and must to be placed before any HTML tags.
Using Meta Tag “Refresh”
By using the Meta Tag “refresh” you can notify the user of the correct new URL and can automatically redirect them to the new site. The refresh tag also allows you to make your site more user-friendly.
Note that meta tags go in the <head></head> section of the HTML document. Also, text within the title tag plays an important role in helping your web pages to rank high for search engines. So it is pretty important to change the Title text as well.
You can adjust the amount of time that the old/original page is displayed by changing the number in the refresh content="5; portion of the meta tag. If you want to have your users automatically taken to the correct page without any wait, then set the number equal to zero content="0;.
Not all browsers support the Meta “refresh” tag, so it is usually a good idea to include a clickable link to the new URL.