How to Create a 301 Redirect - 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. Please also ensure that you have a hosting plan, otherwise, the .htaccess editor will not be visible on your dashboard.
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.
- Log in to your account Hosting Summary.
- On the left pane, click on .htaccess Editor.
- Select the domain from the drop-down 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.
- Add one of the following code snippets into your .htaccess file (based on what you want to do.
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.