How To Redirect a Subdomain to Url: A Complete Guide

Wondering how to redirect a subdomain to URL and a domain to a subdomain, but confused by all the tech jargon?

Article's banner

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.

Takeaways
  • 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

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

Final: How to Redirect a Subdomain to URL: Complete Guide

Source: Cloudflare

CloudFlare suggests you redirect using their Page Rule feature.

  1. Log into your Cloudflare account.
  2. Click the appropriate Cloudflare account for the domain where you want to add URL forwarding.
  3. Go to Rules > Page Rules.
  4. Under Page Rules, click Create Page Rule. The Create Page Rule for dialog opens.
  5. Under If the URL matches, enter the URL or URL pattern that should match the rule.
  6. In Pick a Setting, choose Forwarding URL from the drop-down menu.
  7. For Select status code, choose 301 (Permanent Redirect) or 302 (Temporary Redirect).
  8. Enter the destination URL.
  9. To finish, click Save and Deploy.

Check Out Our Best Domain Hosting Picks

How to Redirect a Subdomain to URL in AWS / Route 53

aws route 53

Source: aws.amazon.com

  1. Log into your AWS account and select “Route 53” from the list of services.
  2. In the left-hand navigation menu, click “Hosted Zones” and then click on the domain for which you want to create a subdomain redirect.
  3. Click “Create Record Set” at the top right of the page and enter your desired subdomain name (e.g., blog) in the “Name” field.
  4. 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.
  5. Click “Create Record Set”.

How to Redirect a Subdomain to URL in Namecheap

Final: How to Redirect a Subdomain to URL: Complete Guide

Source: Namecheap

  1. Log into your Namecheap account and select the domain on which you want to create the subdomain.
  2. Click “Advanced DNS” in the left-hand navigation menu and then click “Add New Record” at the top right of the page.
  3. 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.
  4. Click “Save All Changes” to apply the changes.
Namecheap
Namecheap offers versatile hosting solutions with an intuitive interface and premium features such as automatic backups and free email accounts. With access to numerous single-click apps and award-winning customer service, Namecheap ensures a seamless, user-friendly experience.
Visit Namecheap

How to Redirect a Subdomain to URL in cPanel

  1. Log into your cPanel account and click on “Subdomains” under the Domains section.
  2. Question copy the link of your subdomain.
  3. Paste the name of your subdomain and select the domain it will be created for, then click “Create”.
  4. Click on the newly created subdomain and scroll down to find the “Redirects” section.
  5. Select “Permanent (301)” from the dropdown list, enter your URL in the “Redirects to:” field, and click “Add”.

Learn more:

Short on Time? Check Out Top cPanel Hosting Providers

Best cPanel Hosting Picks
User Rating
5.0
4.8
4.8

How to Redirect a Subdomain to URL in WordPress

  1. Log into your WordPress account and select “Settings” from the left-hand navigation menu.
  2. Answer copy link the URL of the page you want to redirect visitors to.
  3. 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.
  4. 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.
  5. 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:

Final: How to Redirect a Subdomain to URL: Complete Guide

Source: Namecheap 

  1. Log in to your domain registrar’s website
  2. Go into the DNS management section, or “Advanced DNS” as found in NameCheap
  3. 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

Final: How to Redirect a Subdomain to URL: Complete Guide

Source: GoDaddy

  1. Log in to your GoDaddy account and click on “My Products”.
  2. Select the domain you want to redirect and then click on the DNS option at the top of the page.
  3. Scroll down until you see a section labeled “CNAME Records” and click “Add” next to it.
  4. 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.
  5. Click “Save” when done.
GoDaddy
GoDaddy stands as a global web hosting titan. Offering a comprehensive suite from domains to tailored hosting solutions, they're trusted by millions worldwide. Ensure a seamless online presence with GoDaddy's unmatched reliability and innovation.
Visit GoDaddy

How to Redirect a Domain to a Subdomain Using .htaccess

  1. Create a .htaccess file if you don’t already have one in your root directory.
  2. 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]“`
  3. Replace “example” with your domain name and save the changes to your .htaccess file.
  4. 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

Final: How to Redirect a Subdomain to URL: Complete Guide

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

Frequently Asked Questions

Can a subdomain redirect to another domain?

The answer is yes, a subdomain can be redirected to another domain. This is done by setting up an A record in the subdomains DNS settings and then creating a redirect from the subdomain to the other domain.

How to redirect subdomain to a certain IP address along with a port? 

To redirect visitors to a subdomain to an IP address along with a port, you need to point the subdomain to the server’s IP address. This is done through your domain registrar or web hosting provider’s DNS zone editor.

Once you have pointed the subdomain to your server’s IP address, you can use port forwarding rules in your router and configure the application running on that particular port so it responds to requests sent by visitors using this URL.

How do I link a subdomain to a URL? 

You can link a subdomain to a URL by redirecting the subdomain. To do this, you will need to modify your web server settings and create a new record for the domain in your DNS zone file. You should also make sure that you have an SSL certificate installed so that all of your traffic is encrypted and secure.

Can you redirect to an external URL? 

The answer is yes, a subdomain can be redirected to an external URL. All you need to do is create a CNAME record in the DNS settings of your hosting provider and change it to point to the new URL.

Can you use CNAME to redirect a subdomain?

CNAME (Canonical Name) is a type of DNS record that can be used to redirect one domain name to another. Therefore, the answer is no, CNAME cannot be used to redirect a subdomain, root domain, or other domains. The answer? It only works for domains and top-level domains (TLDs).

Can You Redirect a Subdomain Using DNS?

DNS (Domain Name System) is a system used for translating domain names into IP addresses. Therefore, the answer is no, it is not possible to use DNS alone to redirect a subdomain. So you’ll need to use other methods such as URL redirection or setting up a webserver.

Email Marketing vs. Social Media: Which is More Effective?

What is Email Marketing? Email marketing is a  that involves companies reaching out to potential and existing customers via email ...
10 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Email Engagement Metrics, Calculation & Best Practices

Email engagement tells us how interested recipients are in the content of emails they receive. It provides insights into what types of em...
12 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Email Cadence: What Is It & How To Optimize It Right

Email cadence guides you when and how often you should reach out to your customers. Think of it as your personal plan that helps you decide wh...
15 min read
Ela Gal-Kfir
Ela Gal-Kfir
Digital Marketing Specialist

Co-Marketing: What It Is, How to Start & Benefits for Your Business

When it comes to modern business strategies, co-marketing is a smart move for businesses. It means two or more companies work together, sharin...
10 min read
Kaitlin Culmo
Kaitlin Culmo
Hosting Expert
HostAdvice.com provides professional web hosting reviews fully independent of any other entity. Our reviews are unbiased, honest, and apply the same evaluation standards to all those reviewed. While monetary compensation is received from a few of the companies listed on this site, compensation of services and products have no influence on the direction or conclusions of our reviews. Nor does the compensation influence our rankings for certain host companies. This compensation covers account purchasing costs, testing costs and royalties paid to reviewers.
Click to go to the top of the page
Go To Top