Software Engineering Technology Web Development

How do I forward a root domain to 'www' in GoDaddy while preserving the full URL?

2 Answers
2 answers

How do I forward a root domain to 'www' in GoDaddy while preserving the full URL?

1
There are several posts on Godaddy support forum, mentioning about using the subdomain forwarding in 'Manage DNS' section to forward example.com to www.example.com. The forwarding only works if you exactly type example.com in address bar.

But that feature does not work in following cases:
  • If your URL is more than a domain name. e.g. example.com/xyz will not get forwarded to www.example.com/xyz
  • If you type https://example.com it will not be forwarded to https://www.example.com
If you want the above cases to work, GoDaddy wants you to host your website on their own Hosting platform, so if you are AWS/Google Cloud/Azure/Digital Ocean customer, then you are out of luck with the domain forwarding option in GoDaddy.

How to fix it:
  • Remove the subdomain forwarding from GoDaddy's Manage DNS.
  • Add A record with @ entry, pointing to the IP address of your hosting server(from where you serve your website)
  • Implement the URL handling/forwarding in your website

You need to handle all the root to www traffic on your own, where you have hosted your website. And there are several ways to host your website, so it would depend on how you have implemented your deployment. Here are a couple of examples
app.get('/*', function(req, res, next) {
  if (req.headers.host.match(/^www/) !== null ) {
    res.redirect('http://' + req.headers.host.replace(/^www\./, '') + req.url);
  } else {
    next();     
  }
})
Wrote answer · 7/18/2022
Karma · 1435
0

To forward your root domain (e.g., example.com) to the 'www' subdomain (www.example.com) in GoDaddy while preserving the full URL, you need to use a forwarding with masking approach.

Here's how to do it:

  1. Log in to your GoDaddy Account: Go to the GoDaddy website and sign in to your account.

  2. Navigate to your Domain Management: Go to the "My Products" page and find the domain you want to forward. Click the "DNS" button next to your domain to access the DNS Management page.

  3. Forwarding Settings:

    • In the Domain settings page, look for the 'Forwarding' Section, it will often be below all your DNS records.
    • Click the 'Add' button under 'Forwarding'.

  4. Set up the Forward:

    • Select 'HTTPS' for the forwarding to protocol if you have SSL/TLS certificate installed, otherwise use 'HTTP'.
    • In the 'Forward to' field, enter your full 'www' subdomain URL (e.g., https://www.example.com if you use a SSL/TLS certificate).
    • Select 'Forward with masking'.
    • Fill in the settings for:
      • Title: The title you want to appear in the browser tab.
      • Description: A brief description of your website for search engines.
      • Keywords: Keywords related to your website, separated by commas.

  5. Save your settings: Save the forwarding settings and wait for the changes to propagate. DNS propagation can take up to 48 hours, but it's usually faster.

Important Considerations:

  • DNS Propagation: Remember that DNS changes can take some time to propagate across the internet. Be patient and allow up to 48 hours for the forwarding to take effect.
  • SSL Certificate: If you have an SSL certificate installed on your 'www' subdomain, ensure you forward to the HTTPS version of the URL.
Wrote answer · 3/14/2025
Karma · 40

Related Questions

What's a leading front-end development framework?
Write short notes on CSS and XSL.
How do I fix the error "Argument of type 'MonoTypeOperatorFunction<RouterEvent>' is not assignable to parameter of type 'OperatorFunction<Event_2, RouterEvent>'" in Angular?
Is it possible to change the HTML tag of the string in the second column, 'td', to another HTML tag like 'span'?
How to convert आई into %E0%A4%86%E0%A4%88 and how to convert %E0%A4%86%E0%A4%88 into आई? Is there a tool for this? I want to add this for my website post URL like Wikipedia. Are there any disadvantages to doing this?
Can I add CSS in Google Tag Manager (GTM)?
How can I add a `<style>` tag in the `<body>` tag? What is the right way to add a style tag in the body tag? I want to give CSS to a particular post because I don't want to put a lot of CSS in the `<head>` tag of the template. If not, please tell me another way?