1. Knowledge Base
  2. >
  3. Results
  4. >
  5. Article

How to Create a 301 Redirect

The code used in this video

Why Use a 301 Redirect?

To redirect a site permanently, one should use a 301 redirect. This type of redirect is best for SEO purposes and also informs the search engines that the site has moved permanently. If you change your domain name and want to point to a different URL, a 301 redirect is your best choice.

This is also the preferred type of redirect to use when configuring an SSL certificate where you want to redirect your site visitors from a non-secure address like http://example.com to a secure address like https://example.com.

The 301 Redirect setup steps are different based on how your website was built. For WordPress users, a Plugin can be used to configure the 301 Redirect (Out of our Scope of Support). Or you may contact us for Professional Services.

Once a 301 redirect is set, the update should be instantaneous. 

Note: This is only recommended for advanced users. An error could result in your website(s) being disabled.

The .htaccess editor is a powerful tool with which advanced users can customize their website. When using this tool, your first step will always be to select the domain and directory where you are applying the changes.

select the domain and directory
  1. Log into your account, Hosting Summary.
    Log into your Hosting Summary
  2. In the left pane, click on .htaccess Editor.
    .htaccess editor
  3. Select the domain from the dropdown and then a directory and then click on Use Direct Editor. Note: It is important to select the right domain name in this field so the 301-redirect will be applied to the correct website. 
    Select the correct domain from the dropdown
  4.  Add one of the following code snippets into your .htaccess file (based on what you want to do.
Old to new domain - Change the word "OLDDOMAIN" to the old domain name you want to redirect to and change the "NEWDOMAIN" to the new domain name it is redirecting to.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^OLDDOMAIN.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.OLDDOMAIN.com [NC]
RewriteRule ^(.*)$ http://NEWDOMAIN.net/$1 [L,R=301,NC]


HTTPS - Redirect for SSL Certificate, change the word "DOMAIN" to the domain name that requires the redirect from HTTP to HTTPS. Click Save.
RewriteEngine On 
RewriteCond %{HTTP_HOST} ^DOMAIN.com [NC]
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.DOMAIN.com/$1 [R=301,L]


IMPORTANT
  • If there is already a RewriteEngine in your .htaccess file, only copy the rest of the code
  • When you’re editing your .htaccess file, it is essential to note that lines beginning with a hashtag are comments and are not included in the .htaccess rule. When you’re adding rules, you must include them either above or below the default rule

Stuck? Call us at 877-472-4399 to have our Domain Professional Services set up 301 redirect for a small service fee.

What if I want to redirect my domain using DNS instead?
yieldmanager

Thanks for visiting! Since you landed on this page of our website, we wanted to let you know you visited one of our paid endorsers while researching your purchase. close