Looking for a way to redirect your subdomain to another URL, or another domain, but you don’t know how to go about it?
We’ve got you covered, so you won’t have to do any of the research yourself! In this guide, we’ll dive into all the ways to redirect a subdomain. We’ll explain different methods, and compare each of them in a clear overview.
In this article you'll find:
- What is a subdomain redirect?
- Why would you redirect a subdomain?
- Do you need to redirect www. URLs to non-www. URLs?
- Ways to redirect a subdomain
- How to redirect a subdomain using redirect.pizza
What is a subdomain redirect?
A subdomain is a segregated domain linked to your main domain. It is a way to separate content from your main website to organize it. For instance, if you host a blog, you can use a subdomain for all your blog articles. Or if you host a webshop, you can use a subdomain for that.
A subdomain redirect is used to redirect traffic from your subdomain to another domain, or another URL. Traffic intended for the subdomain can be automatically redirected to any preferred place. For example:
- Redirecting one subdomain to another: blog.example.com to articles.example.com
- Redirecting a subdomain to a directory: blog.example.com to www.example.com/blog
- Redirecting a directory to a subdomain: www.example.com/blog to blog.example.com
It’s also possible to redirect your www. subdomain to your apex domain, also called your root domain or naked domain. This can also work the other way around. For example:
- https://www.example.com to https://example.com
- https://example.com to https://www.example.com
Why would you redirect a subdomain?
There are a few reasons why you'd want to redirect a subdomain to your primary domain. Firstly, to consolidate all the content on the primary domain. Secondly, to minimize maintenance of the website. Lastly, there are a number of SEO related benefits to redirecting a subdomain to the primary domain explained below.
Redirecting a subdomain, such as "blog.example.com" to the primary domain "www.example.com/blog" means that when users or search engine crawlers go to the blog subdomain, they are automatically taken to the blog directory on the main website. This is also the case for any SEO value from backlinks pointing to URLs on the subdomain. In other words, the backlink value is transferred to the destination URL on the primary domain, if a permanent redirect is used.
In terms of SEO, a subdomain is often seen as a separate entity for search engine crawlers. This means that backlinks pointing to the subdomain (e.g. blog.example.com) will not increase the domain strength of the the primary domain (e.g. www.example.com). Hence many website owners decide to redirect subdomains to the primary domain.
Do you need to redirect www. URLs to non-www. URLs?
Most websites are accessible via both the "www." and "non-www." URLs. For example:
- https://www.example.com/article
- https://example.com/article
When users land on one of these URLs, they both display the same page. This means that your entire website is essentially duplicated. Redirecting the "www." subomain to the apex domain, or the other way around, is a general best practice for website owners to ensure that users and search engines all visit one version of the website. This will also eliminate any SEO-related issues arising from duplicate content penalties.
Ways to redirect your subdomain
Redirecting a subdomain might not seem like an easy process, since it requires making changes in your DNS settings while making sure you set up the proper redirects. But that’s why we’re here to help! Let’s take a look at the options for setting up a subdomain redirect.
For redirecting a subdomain, different hosting environments offer various methods, each with its own set of pros and cons.