There are several methods available using .htaccess file to redirect user from one page to another. 301 is one of the type to redirect user from one page to another.
301 Redirection also known as Permenant Redirection.
In this article we will see how to set up the 301 redirection from .htaccess file. 301 redirection can be setup in two different ways. We will see both the ways over here.
Unlike normal rewrite 301 redirection will change the URL in address bar.
If you want to redirect only some of the pages to be redirected to other page using 301 redirection then you can check below methods.
If you are moving to new website and want all your visitor of old site being redirected to new site then here is the code for you . :)
So here are the two methods with which you can redirect your user from one page to another page or from one site to another site. Both will works fine so its totally up to you for which one to use in you project.
Subscribe to our RSS feed for more htaccess tricks.
Avinash Zala currently working at a leading web development company as a Sr. PHP Web Developer. He is the founder of the Xpert Developer. He has completed B.E. in Information Technology. Born and brought up in Ahmedabad. He loves to code and coding is all about passion for him. Follow him on twitter at Avinash Zala & Xpert Developer.
View all posts by: Avinash