Every site owner will eventually need to send visitors from one page link to another.
That’s what a redirect command helps you do.
Learn about the different types of redirects, how to create them, and when to use them.
Plus, learn about the caveats of redirects and why too many could be a performance issue.
What is a Redirect?
A redirect is a bit of code that automates the process of sending site visitors from one link to another.
For example, let’s say I created a post with the link to First Post
like this: https://blogaid.net/first-post
But a year later the info on that post is old, and I’ve created a new post that I want visitors to go to instead with a link
like this: https://blogaid.net/new-post
The problem is that the original post link is plastered all over my site and social media, and maybe even in PDFs my visitors have downloaded from my site.
By using a redirect, anytime a visitor clicks on the First Post link, they will be automatically be taken to the New Post link instead.
In other words, they will never see the original First Post.
The real beauty of it is it doesn’t matter whether First Post exists anymore or not.
I could delete First Post completely and just use that existing link in the redirect to New Post.
Types of Redirects
There are 4 popular redirect types. Each has a specific use.
- 301 – permanent redirect and passes link juice
- 302 – temporary redirect and does not pass link juice
- Link shortener – create a shorter slug that’s easy to remember, or for use on social media
- Regex – Regular Expression – generally used for pattern redirect recognition, like:
- Forcing all http links to use https
- Permalink structure change – like from year/month to postname
Read: Follow and NoFollow Links and SEO for more on what passing link juice means.
When to Use Redirects
Following are common uses for redirecting site visitors from one link to another.
Be sure to use the right type of redirect, as it impacts your SEO.
Deleting Old Posts
Let’s say you wrote a post 2 years ago on a topic. And now you’re a far better blog writer and want to create a whole new post because the original one is just not worth updating.
But, the original post has been indexed by Google and still gets a few clicks.
Instead of just deleting that post and letting all clicks to it return a 404 error page of not found, you could delete the post and redirect its link to the new post’s link.
In fact, that’s exactly what Google recommends that you do.
Whenever you delete old content, Google would rather you redirect it to newer or similar content.
You would use a 301 redirect for this scenario.
Any link juice the original post had with Google would mostly flow over to the new post, giving it a good head start in life. (You do lose a wee bit of link juice with a redirect.)
Avoiding 404 Error Pages
When site owners delete a bunch of old posts, they don’t want to suddenly create a bunch of 404 broken links.
And they don’t have new or similar pages to redirect the deleted posts too.
Some site owners set up a regex to send all 404s to the home page of the site instead of a 404 error page.
While there are disagreements among SEOs about this practice, and even Google has waffled on it, I think it’s a mistake.
First, it’s a shock to the visitor.
They clicked on one thing and they were taken to a page that does not have the content they were looking for and they may have no clear way to find something similar.
Second, a good 404 page can actually salvage the visit instead of the visitor just bouncing from your site.
I highly recommend creating a custom 404 page.
You can:
- personalize the message the visitor sees
- List recent posts
- List categories
- Include a search box
- Include links to your important pages
- Include an optin and social media links
Check out BlogAid’s 404 page for ideas.
Shorter Link
Let’s say you create a sales page for your new whiziwig.
The permalink for that page is
https://blogaid.net/greatest-whiziwig-on-the-planet-bar-none
Well, that’s a little too long for folks to remember easily or for you to share on social media.
You could create a redirect from the original to
https://blogaid.net/whiziwig
That’s easy to remember and shorter to promote.
You would generally use a 301 redirect for this scenario, but you could use a 302 redirect as well, especially if you intend to delete the redirect at some point.
TIP: If you are creating a new page, consider shortening the slug of the permalink before you publish the page instead of creating a redirect.
Cloak Affiliate Links
Affiliate links tend to be long and ugly.
Shortening the link with a redirect makes it easier to promote and share, plus it cloaks or hides all of your affiliate info contained in the link.
For example, my affiliate link for NameHero Hosting is https://blogaid.net/nh
Be careful with cloaking affiliate links!
Some affiliate Terms of Service agreements don’t allow you to cloak their links. Affiliate links from Amazon are a good example. So, be sure to check with your partner program before creating redirects.
You would use a 302 redirect for affiliate links.
All ad networks use 302 redirects as well.
Permalink Structure Change
Let’s say you set up your WordPress site years ago when the default permalink structure included the date,
like https://blogaid.net/2012/10/my-post
and you want to change to the new popular permalink structure of postname,
like https://blogaid.net/my-post
And you want to make this change site wide.
That’s where regex redirects come into play.
A regex can recognize the old pattern and change it to the new one.
TIP: It’s very easy to change from one of the older default permalink structures to postname.
Yoast has a super post with a step-by-step tutorial and a special tool (also linked in that post) to walk you through making the switch.
NOTE: it’s not easy to change a permalink structure that has a category name in it. You’ll want a pro regex expert to help with that.
HTTPS Redirects
WordPress internally handles redirections from www or non to the canonical version.
For example, if you input
WordPress will internally redirect you to
But HTTP and HTTPS are handled at the server level.
You need a regex redirect to force all links to the HTTPS version after you convert your site.
Be careful of using a plugin to convert your site to HTTPS.
Your site is not actually converted. All links are just forced to use the HTTPS version.
Some HTTPS regex codes cause multiple redirects. Worse, some use 302 redirects.
I’ve tested 14 HTTPS regex codes I found in online tutorials, even those recommended by hosts.
Some cause up to 4 redirects before landing on the final destination page.
That’s a huge no-no!!!
Plus, it’s a security and performance issue.
And, if it uses a 302 redirect, you can kiss your link juice goodbye – another huge no-no!!!!
Get your site fully converted to HTTPS the right way.
Redirect Plugins
There are three very popular plugins to make creating redirects easy.
They are:
- Pretty Links
- Redirection
- Yoast SEO Premium
Each serves a different purpose.
All can be a resource hog.
So choose wisely.
The Pretty Links plugin is specifically made for those who need to track clicks and revenue on affiliate links and ads.
It keeps a log of all that info and those logs cannot be deleted.
The logs are held in your database.
Depending on how heavy an affiliate marketer you are, your database could become super heavy with those logs. A bloated database affects performance.
So, don’t use this plugin unless you need that tracking functionality.
The Redirection Plugin also has logs for both clicks and 404s. But, both of these logs can be turned off or set to clear periodically.
If you never check the logs, turn them off.
If you do want to periodically check the logs, unless you absolutely have to track the entire click history, set them to clear periodically.
TIP: I’ve heard of folks using this plugin to track 404 broken links all over the site. No!!!! That’s what Google Search Console is for. Stop overloading your database with this info.
READ: Redirection: How to Easily Create Redirects in WordPress for a full tutorial
The Yoast SEO Premium plugin also has an interface for creating redirects.
It works, but honestly, I wouldn’t use it. This makes keeping up with your redirects harder. Plus, Yoast tweaks on this plugin all the time. If it were me, and I wanted to use a plugin, I’d get one that is dedicated to this task.
READ: Export Yoast Premium Redirects to the Redirection Plugin for a full tutorial.
Redirects in .htaccess and cPanel
When you create redirects with plugins, the process slows down page load time for the visitor.
- First, an instance of WordPress has to be opened.
- Then the plugin has to open.
- Then the redirect has to be located.
- Then another instance of WordPress has to be opened to display the page with the target link.
Not only is that slow, it chews up a lot of host system resources.
The faster and better way to create a redirect is directly in the .htaccess file.
The .htaccess file is the gatekeeper for everything that visits your site, both human and bot.
It can redirect links immediately and doesn’t even have to open WordPress to do it.
But, you have to enter code into your .htaccess file to do this, and that’s what puts most site owners off and why they prefer plugins.
If you want an interface to write redirects to the .htaccess file, there is one available in your hosting control panel if you use cPanel.
However, it will create a bulkier regex set of code instead of a single line redirect.
If you feel comfortable editing your .htaccess file, there are LOTS of free redirect generators for Apache online. (Apache is the OS of your host server. Litespeed servers can make use of Apache code too. Check with your host to see what type of server you’re on.)
You simply input the old and new links and it spits out the redirect.
Be sure to turn the ReWrite Engine on just prior to the redirect code!
A typical 301 redirect from one post to another on the same domain looks like this
A regex example looks like this
Don’t Overuse Redirects
The problem with putting a bunch of redirects in .htaccess is that it could slow your site speed.
Everything has to go through that .htaccess gate. And if it has to check for tons of redirects, that could take time.
To my knowledge, there is no data showing how many redirects are too many in .htaccess.
My rule of thumb is no more than 30.
If there is a pattern to a bunch of redirects, use a couple of lines of regex code to handle them instead of individual redirects.
Redirecting Domains
There are two ways to do this, depending on the situation.
You can:
- Forward a domain
- Redirect a domain
Forwarding a Domain
I own the domains blogaid.net and blogaid.com.
I wasn’t able to purchase the .com version for 4 years.
But, when I finally got it, at my domain registrar, I set it to forward to the .net version.
That way the redirect is instantaneous.
And, any visitor coming to the .com version is sent to the .net version, which runs through the CloudFlare CDN for better speed and bot protection.
Read: How CloudFlare Makes Your Site Faster and Safer
You can also forward domains to a page on your site.
So, if you have a domain for your name, you can forward that to the About page on your business site.
Redirecting a Domain
Let’s say you have an old site and you want to start a similar new site, but with a different domain where most all of your pages will have the same title.
And you want to send all traffic from the old site links to the new one.
In that case, you’d want to create a regex on the old site with a pattern to send all old domain page/post links to all new domain page/post links.
The purpose of the regex redirect is to respect all links from the old site already indexed in search engines, or bookmarked by the visitor.
If you wanted to, you could delete the old site and make the domain an add on at your host. That way you would have a folder to place an .htaccess file in to hold the regex redirect.
Need Help with a Site Revamp?
Changing your link structure or major site changes can be confusing. Sometimes it’s just easier to talk over your project with someone who has been there and done that and can help you select the best options.
Contact me for a consult and we’ll make a plan together.