Easy steps to create 301 Redirect

301 redirect may be a type of permanent redirect from one URL to a different. 301 redirects users and search engines to a distinct URL than the one they need truly inserted in their browser.

Let’s see the steps to creating a 301 Redirect Using .htaccess

1. Log in to Control Panel.

2. Go to .htaccess Editor.

3. Go to Direct Editor.

4. To select in which directory you want to place the 301 redirects Click on Change .

5. Depending on the task that you want to perform add any one of the following given code snippets into your .htaccess file:

1) Old to a new domain

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]

It will Update “OLDDOMAIN” to the previous domain that you just wish to redirect to and can update your “NEWDOMAIN” to the domain to which it’s already redirecting.

2) Https Redirect :

RewriteEngine On

RewriteCond %{HTTP_HOST} ^DOMAIN.com [NC]

RewriteCond %{SERVER_PORT} 80

RewriteRule ^(.*)$ https://www.DOMAIN.com/$1 [R=301,L]

It will Update the “DOMAIN” to the domain that needs the redirect from HTTP to HTTPS.

6. Click on Save.