Written by: Hayley Bonnett
Published: 21 March, 2023
Gone are the days when you need to use Cloudflare just to redirect your non-www domain to your www domain in HubSpot! 🙌
With the recent availability of the root/apex domain in HubSpot, redirecting your core domain to your subdomain without a third-party tool is now possible and straightforward.
Before you begin, make sure you have your DNS info on hand and that you can access the account. This info will be in your domain registrar account (i.e., GoDaddy). You'll need the permission level to edit these settings and create new records.
In your HubSpot settings, head over to "Website > Domains & URLs" and this will bring you to the "Domains" tab. Scroll down the page and you'll come to a section called Redirected domains.
You most likely already have either your www or non-www domain set up as the primary domain of your site. As an example, we have our site set to use the www subdomain as our primary domain.
We want to redirect the sub-domain https://domain.com to the www version of the domain so we are going to click that Connect a redirect domain button and add in our domain without the www.
If you have multiple domains in your account you can select which one you want to redirect it to. Because we want to redirect the non-www domain to the www domain, we'll select this one from the dropdown list.
HubSpot has a great walkthrough for the domain set-up and the next step will give you all the info you need to set up your DNS.
HubSpot will also alert you to any conflicting records in your account that need to be addressed.
After selecting the domains to connect to, return to your DNS Manager. If an existing A record is editable, go ahead and edit it. However, if the A record is not editable, it means that it is managed elsewhere and you will need to delete it from there. Once done, you can add an A name record.
Note: If you are using Cloudflare for your DNS management you will want to turn the Proxy off or else your site isn't going to load.
Create new A records for both IP addresses provided by HubSpot.
Once you have completed adding in your new A Records in your DNS manager, you will want to verify that you've done it correctly.
After you click the next step to verify your DNS records in HubSpot you'll get the hourglass indicating that it's WIP and you need to wait.
As your DNS settings update your site may become unavailable. You'll probably have a bit of a panic when it does, but don't freak out too much yet. There are tools available to check the status of the updates and to find some reassurance that it IS updating and not just down for everyone forever.
Check the propagation progress by going to whatsmydns.net. Search for your core domain (domain.com without the www. subdomain) and make sure to check the A record as well.
You should see a few locations begin to propagate, but not all locations will propagate at once. For all locations to propagate, it can take up to 24 hours. See in our example here Germany and Rhode Island haven't propagated yet, but the rest have.
The IP addresses showing on that list should start updating to show your new IP for the subdomain shortly.
It may take up to an hour for the new domain to be verified. If it takes longer than an hour, it is recommended to contact HubSpot support.
Next, the SSL processing will start which could take up to 4 hours. This could also cause issues with you accessing your site either by showing some security warnings or not letting you access the site in the process.
As you wait, feel free to complete the following steps regarding security features.
Back in HubSpot under Website & Domains, under the redirect section you'll see an “Edit” button that will give you a dropdown menu where you will select "Update domain security settings”.
In the "Security headers" tab, enable HTTP Strict Transport Security (HSTS). Then Enable Preload, and be sure to Include Subdomains. We recommend that the duration be set to 6 weeks initially, then increase the duration back up in subsequent months. This can get your updates noticed and sorted faster.
After redirecting your core domain to the secure version of the domain, make sure to test that the redirection is working properly. Check both the HTTP and HTTPS versions of the domain without the subdomain (e.g., domain.com) to ensure they both redirect to the secure version of the domain with the subdomain (e.g., www.domain.com). Keep in mind that the redirection may not happen immediately and you may encounter error messages, but this is normal as long as it is temporary.
If the site is not redirecting after an hour, HubSpot recommends contacting their support. HubSpot will provide an update when SSL processing is complete.
Redirecting your core domain to a subdomain in HubSpot is important to improve your user experience, search engine rankings, and domain authority. Now, with the ability to redirect directly in the HubSpot CMS, you can ensure that visitors are directed to the correct subdomain right in the platform.
Need a hand getting your domains set up? Our development team provides a range of website development services to assist you at every stage of your digital journey. Contact us today!
© CRONYX Digital SEZC