How to use .htaccess for permanent redirect 301?

If you are making search engine friendly URL from pages which are using query string (i.e. www.phpmind.com?id=2 ) and pages which are indexed in search engines or if you are rewriting your website with new urls then you need permanent redirect 301!!

Let me tell you what happens here. If you remove a page which is already in Google it will generate error and that is not good for your site.
So .htaccess for permanent redirect will save life! Just redirect old to new url and Google will like your site this is good practice in terms of SEO too.

This one line PHP code is worth to add in .htaccess file of your root directory without loosing search engine ranking in Google and Others.

Redirect 301 /oldPage.html http://mydomain.com/newpage.html

Another Way 

redirectpermanent /contact-me.html http://www.phpmind.com/contact-us.html

Share

Leave a Reply

Your email address will not be published. Required fields are marked *