What is 301 Permanent Redirect
A permanent 301 redirect in your .htaccess file tells the search engines and others that the old link has been replaced by new ones. It's the recommended method for directing your old page traffic from an existing page.It also passes the link value(SEO Term )to new one URL. You can also solve your website multiple version problem by this method.Setting up a Permanent 301 redirect via .htaccess
First you need to create .htaccess file and copy & paste below code into it. and then upload it to on root directory.How to Create .htaccess file.
- Open NotePad editor.
- Copy and Paste the below code into it.
- Save it as .htaccess extension. (don't mention file name just saved it with .htaccess extensions) and select "All files" from "Save as type" from dropdown menu..
- then Save it.
RewriteEngine On
RewriteBase /
# redirect html pages to the root domain
RewriteRule ^index\.html$ / [NC,R,L]
This will redirect your http://www.example.com/index.html page to http://www.example.com/ pass the Link juice of backlinks to main domain.