Google Sites and naked domains
If your domain registrar doesn't support fowarding non-www to www, then you need to use a 3rd party service. Here's how to set up Cloudfare to route non-www traffic to your www website
Google Sites and naked domains
Look at your browser address bar.
You'll see this website is hosted at https://www.googlesites.dev. That full website address is called the fully qualified domain name (FQDN). If you type https://googlesites.dev into your browser, you'll still land at https://www.googlesites.dev. This is called forwarding. The non-www version of the website address is called the naked domain.
Good practice with Google Sites is to host the website under the fully qualified version of the website address, and forward the naked version of the domain to the fully qualified one. I use Porkbun and Squarespace for domains and both providers support redirect, or forwarding, functionality.
Some registrars don't support this, for example Hostinger. In the Hostinger domain control panel, there's no way to make sure that non-www traffic is forwarded to the www version, so you'll need to use a 3rd party service to do this. In this case, I'll describe how to do forwarding with Cloudflare. Equally, you could use NakedSSL.
A basic summary of what you need to do
To forward non-www traffic to the www version of your website, we need to do the following:
Create a free account with Cloudflare
Enter your DNS
Create a redirect rule.
Step 1: Create an account with Cloudflare
Let's get setup on Cloudflare:
Click on Add site and enter your domain name to add it to Cloudflare
Select a plan: There is a free option available - it covers all basic needs for the majority of websites
Step 2: Enter your DNS
Add the DNS record in your Cloudflare's DNS dashboard. You can do it by accessing your website
Then, add your DNS record to connect your domain to the custom domain record (you can add the A/CNAME and other records in your DNS Management in Hostinger, and this should be moved manually):
Then scroll down and you will see a pair of custom nameservers will be generated for your domain. Copy the values and change the nameservers at your domain’s DNS Zone
Enter your domain into the 'Connected domains' box, and click 'Add'.
You may have to follow some steps to verify your domain. If you are, follow step 4 in Porkbun's instructions.
- Add the DNS record in your Cloudflare's DNS dashboard
Step 3: Create the redirect rule
Now go to the page rules section in your Cloudflare and click on create page rules. Create teh redirect rule by following the instructions below:
URL (required) should be filled with your domain name without the www
Pick a setting should be used with and choose Forwarding URL
Then, you can choose 301 - Permanent Redirect for the redirection type
Enter Destination URL should be filled with your domain name with www
To save the redirection, click Save and Deploy Page Rule.
- Page rules
Has this guide helped you?
Help me improve this page! Were the steps clear, did I miss something? Please let me know.