Creating 301 Redirects in WordPress Using Redirection Plugin.
One of the most basic methods of adding a 301 redirect, is by editing your .htaccess file on the server
What is a Redirect in WordPress?
A redirect is a way for your website to send a quick message to your reader’s browser and tell them that the page they want to visit has been moved, so their browser can automatically point them to the new page of your choice.
There are various different types of redirects such as 301 redirect, 302 redirects, 307 redirects, etc.
However, to keep this article simple and useful, we will only cover 301 redirects as that’s the most important.
When do you need a 301 redirect in WordPress?
The primary reason to use 301 redirects is when your site or a page on your site has been moved, and you want to point the user to a new page instead.
– You need to create a redirect when you are planning on deleting a post or page in favor of new content.
– You need to create a redirect when you are planning on changing the permalinks of your post or page.
How to Create Redirects in WordPress (using Plugins)
The simplest way to add and manage redirects in WordPress is by using the Redirection plugin. Install and activate the plugin. Once activated, visit Tools » Redirection to setup your redirects.
Redirection plugin not only allows you to set up redirects, but it also helps you find out 404 errors on your WordPress site. You can then redirect those URLs to an appropriate destination
2. Page Links to
Sometimes you may want to keep a post/page but redirect it to another post or page. This is where Page Links to comes in handy. This simple plugin adds a meta box on your post edit screen where you can enter the address of the new location where you want to send your users.
3. Simple 301 Redirects
Another easy to use the plugin is Simple 301 Redirects. As the name suggests, it makes 301 Redirects simple. Simply install and activate the plugin and then visit Settings » 301 Redirects to add your URLs.
If you want to make your redirects faster, then you can do so by using the coding method and .htaccess file.
Setting Up 301 Redirects in WordPress using .htaccess
Using the web server configuration file .htaccess, WordPress users can set up 301 redirects that are fast.
Please keep in mind that a small mistake in your .htaccess code can make your WordPress site inaccessible, and it may start showing Internal Server Error.
That’s why it is important that you back up your .htaccess file before making any changes.
To edit your .htaccess file, you will need to connect to your website using an FTP client. The .htaccess file resides in your WordPress site’s root directory.
If you can’t see your .htaccess file there, then you need to force your FTP client to show hidden files. (See why you can’t find the .htaccess file on your WordPress site.)
You can edit .htaccess file in any plain text editor like Notepad.
Here is a simple redirect, where we are trying to send a user visiting an old post to a new post.
Redirect 301 /a-very-old-post/
you can add the code above preferably at the end of your .htaccess file.
That’s all. We hope this beginner’s guide to creating WordPress redirects helped you set up redirects on your site.