Wondering how to redirect a subdomain to URL and a domain to a subdomain, but confused by all the tech jargon?
We’ll provide details so there’s no research effort on your part and you can walk away with the best answers to your questions, including a linked related question feed at the bottom of the page.
- Redirecting a subdomain to URL is an easy process that requires making changes in your DNS settings and setting up proper redirects
- You can redirect a subdomain to an external URL in just a few easy steps
- Redirecting a subdomain to a domain isn’t too hard either
- You can’t use CNAME to redirect a subdomain
- You can’t redirect a subdomain using DNS either
- “Redirecting†and “Pointing†are two different processes
If the process feels too technical or confusing, don’t worry.
We’ve compiled a list of top hosting providers who can help simplify things for you:
How to Redirect a Subdomain to a URL
A subdomain is a secondary domain that allows you to organize content and separate it from your main website.
It can be useful for hosting different web pages or services on the same domain name, such as a blog or an online store.
Answering this question shows research effort, but redirecting a subdomain to a URL link is an easy process that requires making changes in your DNS settings and setting up proper redirects.
How to Redirect a Subdomain to a URL on Cloudflare
Source: Cloudflare
CloudFlare suggests you redirect using their Page Rule feature.
- Log into your Cloudflare account.
- Click the appropriate Cloudflare account for the domain where you want to add URL forwarding.
- Go to Rules > Page Rules.
- Under Page Rules, click Create Page Rule. The Create Page Rule for dialog opens.
- Under If the URL matches, enter the URL or URL pattern that should match the rule.
- In Pick a Setting, choose Forwarding URL from the drop-down menu.
- For Select status code, choose 301 (Permanent Redirect) or 302 (Temporary Redirect).
- Enter the destination URL.
- To finish, click Save and Deploy.
Check Out Our Best Domain Hosting Picks
How to Redirect a Subdomain to URL in AWS / Route 53
Source: aws.amazon.com
- Log into your AWS account and select “Route 53†from the list of services.
- In the left-hand navigation menu, click “Hosted Zones†and then click on the domain for which you want to create a subdomain redirect.
- Click “Create Record Set†at the top right of the page and enter your desired subdomain name (e.g., blog) in the “Name†field.
- Select “Alias†from the dropdown list, paste in your URL in the Destination URL field, and select your domain name from the “Alias Target†dropdown list.
- Click “Create Record Setâ€.
How to Redirect a Subdomain to URL in Namecheap
Source: Namecheap
- Log into your Namecheap account and select the domain on which you want to create the subdomain.
- Click “Advanced DNS†in the left-hand navigation menu and then click “Add New Record†at the top right of the page.
- Select “CNAME†from the dropdown list, enter your desired subdomain name (e.g., blog), answer copy link your URL, then paste in your URL in the Destination URL field under Value/Answer.
- Click “Save All Changes†to apply the changes.
How to Redirect a Subdomain to URL in cPanel
- Log into your cPanel account and click on “Subdomains†under the Domains section.
- Question copy the link of your subdomain.
- Paste the name of your subdomain and select the domain it will be created for, then click “Createâ€.
- Click on the newly created subdomain and scroll down to find the “Redirects†section.
- Select “Permanent (301)†from the dropdown list, enter your URL in the “Redirects to:†field, and click “Addâ€.
Learn more:
- What Is cPanel?
- How to Create a Subdomain to URL in cPanel
- Best cPanel Hosting Providers
- Should I Choose cPanel Web Hosting?
Short on Time? Check Out Top cPanel Hosting Providers
How to Redirect a Subdomain to URL in WordPress
- Log into your WordPress account and select “Settings†from the left-hand navigation menu.
- Answer copy link the URL of the page you want to redirect visitors to.
- Select “Domain Mapping†from the list of settings, then paste the URL of the page you want to redirect to in the “Domain Mapping URL†field and click “Save Changes†at the bottom right of the page.
- To add a subdomain, go to “Domains†in the left-hand menu, click “Add Domain†and add your subdomain (e.g., blog) to the field provided.
- Click “Save Changes†at the bottom right of the page.
Learn more:
Can You Redirect a Subdomain to an External URL?
The answer is yes, you can redirect a subdomain to an external URL link. It’s quite easy to do so – all you have to do is create a CNAME record in your domain name system (DNS) records for the subdomain and point it at the desired destination URL.
To create a CNAME Record in DNS, you’ll need to:
Source: Namecheap
- Log in to your domain registrar’s website
- Go into the DNS management section, or “Advanced DNS†as found in NameCheap
- Add a CNAME record with the appropriate settings for your subdomain
Creating a CNAME record in DNS is a general process, and the same basic steps can be used regardless of which hosting provider you’re using.
However, some providers may require specific settings for your CNAME record so it’s important to check with your provider before creating one.
The CNAME record should be set up by your domain host or provider and will ensure that when someone types in the address of your subdomain into their web browser, they are redirected straight away to the assigned destination page.
An internal redirection differs from an external redirection as it only affects pages within one website or domain. Internal redirection is done using a special meta tag in the HTML code of the page, and it instructs browsers to go to another page on the same website.
It’s different from external redirection as it won’t redirect visitors away from your site – they will simply be taken to a different internal page.
How to Redirect a Domain to a Subdomain
Redirecting a domain to a subdomain is fairly simple. All you need to do is create a CNAME record in your DNS that points the domain name to the subdomain. To create this entry, log into your DNS panel and add an entry for “www†with the type “CNAME†and the value of the subdomain (e.g., example.com -> www.example.com).
How to Redirect a Domain to a Subdomain on GoDaddy
Source: GoDaddy
- Log in to your GoDaddy account and click on “My Productsâ€.
- Select the domain you want to redirect and then click on the DNS option at the top of the page.
- Scroll down until you see a section labeled “CNAME Records†and click “Add†next to it.
- Enter www as the Host field, select CNAME in the Type field, enter the subdomain address (e.g., example-subdomain) in the Points to field, and leave TTL set to the default value of 1 hour.
- Click “Save†when done.
How to Redirect a Domain to a Subdomain Using .htaccess
- Create a .htaccess file if you don’t already have one in your root directory.
- Add the following code to the top of the file: “`RewriteEngine On RewriteCond %{HTTP_HOST} ^example.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]“`
- Replace “example†with your domain name and save the changes to your .htaccess file.
- Upload this updated version of your .htaccess file to your web server.
How to Redirect Subdomain to Main Domain
Redirecting a subdomain to the main domain is relatively simple. The process involves making changes in the DNS (Domain Name System) records of the root domain in your website hosting provider’s control panel, such as changing A Record or CNAME Records.
It is important to note that depending on your web hosting service provider, you may need to create a new record called an “A†record or modify an existing one if it already exists.
When Subdomain Redirection Is Not the Answer
A lot of people confuse the terms “redirect†and “pointâ€, but they are two different processes.
Redirection is when you send a user to another URL, while pointing is when you direct a domain name or subdomain to an IP address.
When looking to point a subdomain to another server, redirection will not work. Make a choice on what to do based on your personal experience, not keywords.
How to Point a Subdomain to Another Server IP Address
Source: Namecheap
Pointing a subdomain to another server IP address is a relatively straightforward process.
The first step is to obtain the IP address of the new server.
Once you have this, you should log into your domain registrar’s or web hosting provider’s control panel and locate the option for DNS management, which will allow you to add records for your domain name.
You should then create an A record or URL Redirect Record for your subdomain with the IP address of the new server as its value.
Final Word
Now that you know everything about redirecting a subdomain, you can use this knowledge to many other questions, optimize your website, and bring in as many viewers as possible.
If you’re looking for more help with creating an amazing website that a Google sign or Facebook sign would pick up, check out our reviews of the Best Website Builders and Best Web Hosting.
Next Steps: What Now?
- Decide whether you want to “point†or “redirectâ€
- Redirect your subdomain to a URL using the steps in this article
- Answer your other questions with other answers on the HostAdvice site Use the Best Website Builders and Best Web Hosting to improve your website
Learn More About Subdomains
How to Create a Subdomain for a Primary Domain: Comprehensive Guide
How to Create a Subdomain in GoDaddy with and without cPanel
What Is a Subdomain: Everything You Need to Know
Subdomain vs Subdirectory: Which is Better for SEO?
Domain vs Subdomain: What They Are and What’s the Difference?
How to Find All Subdomains of a Domain with Free Online Tools
Wildcard Subdomains: What They Are & How To Set Them Up
SEO for Subdomains: Benefits, Disadvantages & Strategies for Success
DNS Record for Subdomain: CNAME, DMARC, A Records & more
Email Subdomain: What It Is & How to Use It
SSL Certificate for Subdomain: How to Pick and Install the Right One?
How to Create a Subdomain in cPanel: Step-by-Step Guide
Subdomain Delegation to Another DNS Service Provider: Complete Guide
NGINX Subdomain Tutorial and Setup Guide
How to Create a Subdomain in Namecheap Hosting