How to Create a 301 Redirect on a Domain
Article Number: KB 352
How do I create a 301 redirect on my domain?
Host Records Method
You must be using our DNS servers to use this method (see How to Change Domain Nameservers (DNS)). Set the below host records to perform a 301 redirect to http://www.example.com/:
|Host Name||Record Type||Address|
Please see the article, Forward, Redirect or Point Your Domain/Sub-domain (Change Host Records) for full instructions on setting host records.
In order to create a 301 redirect you will need a place to host an index.asp or index.php file.
If you have already signed up for eNom's web hosting you can place this file in your eNom hosting account. You can also point your domain to another host by modifying your name servers or host records (see How to change domain name servers (DNS) and/or Forward, Redirect or Point Your Domain/Sub-domain (Change Host Records)).
To purchase a hosting account with us, please see the article, How to Purchase Web Hosting.
To create the redirect, use the following code and place it into a file named index.php or index.asp. Then, place the file into the root directory for your domain in your hosting account (see Web Hosting: Upload Files to Web Hosting Account).
You can modify the location in each file, http://www.example.com, to any URL you choose.
301 Redirect in PHP
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.example.com" );
Last Updated: October, 2015