A URL redirect is a simple act of forwarding someone from one URL to the next when they land on the previous URL. For example, if they land on http://www.domain.com and you’d like them to be re-directed to http://www.otherdomain.com, this is when you’d set up a redirect. However, Redirects in WordPress aren’t as simple as they seem because there are different redirects for different purposes.
URL redirects were invented as a way of showing a URL from more than one web page at a time. However, if your site moves location, if you have an old domain you don’t want to cancel or whatever the reason, you can setup some simple redirect rules to get users to the right place when they land on the obsolete domain. This is also a useful technique to use when users stumble on a broken link which results in a 404 page and you don’t want them to be shown a page that says your page is broken.
Some site owners have even been using redirects to prevent phishing or malware attacks on their site. It’s not the most popular form of protection but it does help. Let’s go over the different redirects and their meaning.
Table of Contents
The Easiest Way
The easiest way to create redirects is with the HTACCESS file that’s hidden in every root installation of WordPress. However, you need to be careful with this file because one simple comma out of place or even a space can completely break your site and sub-domains. For that reason, we’re going to discuss the most common redirects and some common WordPress plugins to handle them.
#1 – The 404 Error
This is one of the most common error messages you may encounter when you’re browsing a site and stumble upon a broken link. This doesn’t mean the content never existed but it could have been removed by the user or it was dynamic generated content and the link to the content was never updated. This simply means that the requested content is not found and it may be back in the future. This error and page can show up subsequent times.
#2 – 301 Redirect
This is a permanent redirect used for users upgrading their site from HTTP to HTTPS in most cases. This is usually done on old domains as well when a domain is no longer operational and the user needs to be moved to the new location.
#3 – 302 Redirect
This is what’s known as a temporary redirect. The client or browser will take longer than a 301 redirect but is used for a temporary outage or moving one user to a new domain without indicating a permanent response. When the user visits the obsolete domain, the browser will ask for a new domain and if it’s found, it will redirect them to the new domain.
#4 – 307 Redirect
This isn’t a common redirect request but this is used when a user needs to be redirected but for future browser requests from the same user, the old domain should still be used.
Three WordPress Redirect Plugins
All of these plugins have been recently updated or have been tested to work with the most current version of WordPress. Additionally, they’re all highly rated as well along with great developer support. They’re also free, which is the best part!
All 404 Redirect To Homepage
This is a simple plugin that gives users the ability to avoid 404 errors killing their traffic and bounce rate. You should always take care of pages that are giving a 404 error but if somehow a user does stumble upon them, with this plugin, you’ll send the user straight back to the homepage. It’s better than staring at a 404 screen.
Simple 301 Redirects
When you need a simple method of redirecting a user to a new site after you’ve moved your current site, this is a simple and easy plugin to use. It’s mostly used for people who have moved their site that needs to setup some redirect rules that allow their old pages to seamlessly redirect to their new pages.
This plugin handles 301 redirects and is a bit more in-depth than the other mentioned plugins. Not only can you setup 301 redirects but it also will manage and track all of your 404 errors for you. If users (usually there’s a lot of errors from bots) try to go to a page that doesn’t exist, you’ll be notified. Don’t take all of these literally if you don’t know the traffic source though. It’s not uncommon for hackers to try to ping various pages of your site that don’t exist which can result in a lot of 404 errors.