3 Ways To Redirect A Website URL
When a website is new, the need for redirects may seem foreign. A fresh website with just a few pages is straightforward enough. But over time, websites grow. As you add more pages and build out more categories, you start to have more URLs to deal with. You may realize late in the game that your URLs are more complex than you’d like.
Almost all website owners will at some point face the need to set up a redirect.
What is a Website Redirect?
A website redirect points your old URL to a new page. When anyone types in or clicks on that original URL they’ll be taken to the page you set the redirect up to instead. It ensures visitors don’t end up on a 404 page and instead find something relevant to what they were originally looking for. And it keeps you from losing the value of any links you’ve built to that page—which is important for search engine optimization (SEO), as well as the user experience of anyone that clicks one of those links.
Knowing how to set up a redirect is a valuable skill for anyone that runs a website. You can implement redirects on a page-by-page basis, or at the domain level.
When is it useful to use redirects?
There are many different use cases for redirects. For example, one of the most common use cases is a domain migration/domain transfer, in which case Google itself explicitly recommends 301 redirects and has established its own guidelines.
Other situations where it makes sense to use a URL redirect:
- When different URLs lead to your homepage, for example, https://homepage.com, https://www.homepage.com, and https://www.homepage.com/homepage. In this case, you can select one URL as the URL to be indexed and redirect the other URLs to it to avoid duplicate content.
- When you want to merge two websites onto 1 new domain. In this case, you can redirect the "old" URLs to the new URLs.
- When you've reworked your website structure and/or changed URLs. In this case, for example, you may have created new directories or made other obsolete. If redirects aren't set up, the server will return a 404 error code when retrieving the old URLs. Redirects ensure that traffic and link juice are forwarded to the new URLs and that usability is preserved.
- When you use geotargeting and want to automatically direct your visitors to the appropriate language and country version based on their location. Permanent redirects can be implemented to achieve this..
- When you do affiliate marketing, and links to your website are tracked by an affiliate system. When clicking on the link, the user is redirected - almost unnoticed - to the affiliate provider’s tracking page, and then again redirected to your domain.
- When you want to redirect users to a URL that targets a specific device. The redirects are temporary and a Vary Header must be used.
- When you want to redirect http pages to a version that contains an SSL certificate (https) to avoid duplicate content.
- When you want to redirect pages from your website without "www" to the version with "www" to avoid duplicate content.
3 Types of URL Redirects
There are three main types of redirects to be aware of, although most website owners will only need to use the first.
1. 301 Redirect
A 301 redirect is a permanent redirect. This type of redirect takes place on both a browser and server level. It’s the most commonly used and powerful redirect. It passes on all the SEO authority of the existing URL. And search engines recognize and index this kind of redirect, making it the best choice for SEO.
In almost all cases, this is the type of redirect you’ll want to use.
2. 302 Redirect
A 302 redirect is a temporary redirect. It should only be used when you have the intention of moving back to the old URL at some point. If, for example, you’re redesigning your site, but want to direct users to a different domain while you finish. Or if you want to A/B test two different versions of a page, before committing to a new version.
302 redirects aren’t used very often. If you’re considering using a 302 redirect, consider carefully whether you might be better off using a 301 redirect.
3. Meta Refresh
Have you ever landed on a page and been greeted with a message that says, “The original URL has moved, you’re now being redirected. Click here if you’re not redirected in 5 seconds”? Then you’ve experienced a meta refresh.
A meta refresh is a redirect that functions by telling the browser to go to the new page, without updating the server. When setting up a meta refresh, you can clarify the amount of time it should take for the redirect to the new page to occur. Sometimes search engines interpret a meta refresh in the same way as a 301 redirect, especially if the time allotted is zero or one second. But it’s not entirely consistent how search engines read a meta refresh, and they create a worse user experience by making the visitor wait to get to the page they’re seeking.
In instances where you’re considering a meta refresh, you’re likely to be better off with a 301 redirect.
How to Set Up a Redirect
Most website owners have multiple ways they can choose to set up a redirect. Here are instructions for three common options.
1. Set up a Redirect in cPanel
When signed into your cPanel account, scroll down to the Domains section. Find the icon for Redirects and click on it.
In the dropdown menu under Type, you can choose between Permanent (301) or Temporary (302). Make your selection.
In the next dropdown menu, choose which domain you’re setting up the redirect for. You can choose All Public Domains if you want the update to apply to all the domains you own, otherwise select the appropriate one from the dropdown.
Then simply fill in the page you want to set up the redirect for, and the page you want it to go to. Note that in the first box, you’ll only put the last part of the URL, since the root domain name is already supplied in the dropdown menu. But in the second box, put in the full URL you want it to redirect it to.
2. Redirect in Joomla
To create a new link redirect, navigate to Components > Redirects. As soon as you click on Redirects, you will be in the Redirect dashboard where you can see the list of all the redirect links. You can manage your redirects from there.
Now, click on the New button to create a new Redirection link. Here you have to add your expired and new links in order to create the redirect.
Expired URL - In this field, insert either the path or URL or the old page from which you want to redirect the users.
New URL - This is the new page on which you want to land the users.
Make sure the status is Enabled otherwise it will not work. You can add an optional Comment related to the redirection for your future reference. At last, simply Save the changes.
After saving, test the change by opening the expired URL and it will now redirect to the new URL, and you are done!
Note: Make sure the Expired link you add should show a 404 page and that it should not be a working page anymore.
3. Set up a Redirect in WordPress
The easiest way to set up a redirect in WordPress is using a plugin. One popular option for this is Redirection.
If you’re new to adding plugins in WordPress, select Plugins in the menu on the left side of the screen. Click Add New, then perform a search for the plugin you want.
Click Install Now, then Activate. Each plugin will have its own instructions for how to use it. For Redirection, find it in your Installed Plugins list, click on Settings, then go through the setup instructions.
Once it’s set up, you’ll be able to find Redirection listed under Tools. Then click on Redirects in the menu at the top of the screen, and fill in the information for the URL you want to redirect, and the new URL you want it to point to.
Then click the Add Redirect button.
5 Reasons Why You’d Create a Website Redirect
Now you’ve got three different ways to set up redirects, but if you’re still wondering why someone would bother with this, there are a few main scenarios where it comes up.
1. Redirect a Subdirectory to a Page on Your Site
When you created your site, you may have decided to create your blog page on a subdomain of your site. So, instead of your blog URL being “mysite.com/blog” you made it “blog.mysite.com”. And now you’ve decided that it makes sense to switch your blog off of the original subdomain structure.
This is a case where you’d set up a redirect. The same goes for any other reason you’ve created a site or section of your site on a subdomain, and now you want to switch the URL structure to something new.
2. Redirect Duplicate Content to the Original Page
Having duplicate content on your site is bad for SEO. If you have a large site, you may well have pages with duplicate content. When you have more than one version of the same page it makes it hard for Google to figure out which page to rank.
Avoid duplicate content issues by redirecting the duplicate piece of content to the original. This will both reduce confusion for your visitors and improve your search engine rankings.
3. Redirect Multiple Domains to a Single Domain
Many brands buy up multiple domain names related to their main URL in order to protect your online brand. If your brand is Acme Corp. you may want to own acme.com, acmecorp.com, acme.net, etc.
Instead of buying domains to keep others from registering them, then just letting them sit there, you can redirect them to your main website. Whether they’re common misspellings of your existing domain name, other top level domain name extensions, or something else entirely, they’re worth redirecting back to your main site.
4. Redirect Your Old Domain to Your New One
Did you originally build out your site on a domain that wasn’t your first choice, then managed to buy your dream domain later on? Or maybe you went through a massive rebrand and changing your domain name is now necessary.
Whatever the reason, you need to implement a redirect of your old domain to your new domain. Now, migrating an entire site is more intensive than a simple redirect, but it’s an important part of the process.
5. Redirect an Old URL to a New URL
Sometimes you have to change the URL of existing pages and posts. Maybe you’re cleaning up your existing URL structure, or you moved some pages around and the old URL no longer makes sense.
In this case, you’ll want to implement a 301 redirect from the old URL to the new one. This is especially true if your older posts are already indexed in the search engines, or have links pointing to them anywhere online.
Setting up a redirect may seem intimidating at first for the non-technical website owners out there. But with several intuitive options, it’s a task you should be able to tackle on your own. And using redirects well can help you update your website over time to be more useful, avoid 404 errors, and improve SEO.