Main reason for using 301 redirects in wordpress is to redirect the users that visit your website link that you moved or changed and you want to point them to new page or post instead. If we don’t give redirect to the moved post or page you will see a 404 not found error. It will make negative impression to the users and also cause in site’s SEO and search engine ranking. So that 301 redirects is very important. This will tell the search engine and your users browser that the page they are tiring to reach is permanently changed to new location.
This will make all your traffic from old post’s, page’s and backlinks go to new page or post. So that you will not loose the traffic.
So that I wrote about how to create 301 redirects in wordpress using different methods.
Setting Up 301 Redirects using Plugins
The best way in wordpress is to using redirect plugin to create and manage 301 redirects. So that you don’t need to write any single line of code to setup redirects. There are many redirect plugins available for free in wordpress plugins page.
For create and manage redirect in wordpress is by using redirection plugins. First you have to install and activate the plugin. After activating visit Tools » Redirection to setup and mange redirects. This plugin not only helps redirection it also help to find 404 errors on you wordpress site. So that you can redirect those URLs to an appropriate destination.
This plugin is also easy to use. You have to install and activate the plugin and then visit Settings » 301 Redirects to add and manage URLs.
This plugin has many other features that the other plugin don’t have. In this plugin you can set a redirect page or menu link to open in a new window and also you can add a rel=”nofollow” attribute to the page or menu link of the redirect (This will not work on permalinks). Install and activate the plugin and visit Redirect Option » Quick Redirects to add and manage redirects.
If you want to keep post or page and you want redirect to another post or page. This plugin will help this functionality by adding a meta box on your post’s and page’s edit screen where you can enter the address of new post or page you want to redirect.
Setting Up 301 Redirects using .htaccess in WordPress
Setting up 301 redirect by wordpress plugin is simple but there is a minor problem in performance based on wordpress hosting provider. Your redirects maybe bite slower by some milliseconds. 301 redirects make faster by using the web server configuration file .htaccess.
Warning:Small mistake in .htaccess code can make your website inaccessible, and it will start showing Internal Server Error. That’s why it is important that you backup your .htaccess file before making any changes.
To access your .htaccess file you need to connect to your wordpress website by FTP clients. It is located in wordpress root directory. If you didn’t see .htaccess file there, then you need to force FTP client to show hidden files. Then you can edit .htaccess file in any text editor like Notepad, Notepad++ etc.
RewriteEngine On Redirect 301 /a-very-old-post/ http://yoursite.com/a-very-new-post/
You can add this code at the end of the .htaccess file.