Skip to main content

How to add a custom domain for your Google site

 First of all, you will need a domain, you can buy it from a domain provider like GoDaddy, it's really simple, you just buy it like any online product, they will send you an account to log in to your domain manager.

After you have a domain, go to your site editor, click on the setting icon (the wheel icon), and select Custom domain.


Click Start setup then click Use a domain from a third party, Click Next.


Fill in your domain, if it has not been verified before, you will see an error telling you to verify your domain, click verify your ownership.


Now it will take you to the domain verification site, select your domain provider, you will have 2 ways to verify your domain, by adding a TXT record or a CNAME record.

First way: Add a TXT record:

Login to your domain manager. Copy the TXT from the verification site and create a TXT record in your domain manager. Your domain manager might look different from mine but it should be similar. Make sure you choose the record type TXT and past the value from the verification site, be sure there are no spaces before or after the TXT value. Then click Add.


Second way: Add a CNAME record.

In the verification site click Add a CNAME record:


Create a CNAME record in your domain manager with values provided by the verification site, make sure you choose the record type CNAME and there are no spaces before or after values you copied. Then click Add.



You only need to add a TXT or a CNAME record, you don't have to add both records. It depends on your domain provider, you have to wait, sometimes it takes 30 minutes, sometimes it can take 2 hours.

You can bookmark the verification site to go back and check if your domain can be verified or you can do the same steps as above and click verify your ownership again to go to the verification site. You don't have to TXT or CNAME record again for the same domain.

Select your domain provider and click verify if you used TXT or click Add a CNAME record if you used CNAME and then click verify. If it does not work try to check it a few hours later. If it still does not work then you can remove the TXT or CNAME record you added and start all over again.

When your domain is verified. Go to your domain manager add another CNAME record with host and value: www and ghs.googlehosted.com




After finish all steps when you go back to Custom domain you will see your domain appear. At this point, you can Publish your site and go to your custom domain to see your site, if it does not work, you can wait for a few minutes.


That's it. Hope this helps.

Comments

Popular posts from this blog

How to use Angular RouteReuseStrategy to create snapshots so you can back to previous pages without reloading data

Github of this  exmaple.  There are a lot of practical scenarios when you load a list of items then go to the detail of an item, when you hit the back button you don't want to reload the item list again. Angular provides you a method to do exactly that. With RouteReuseStrategy when you hit the back button it takes you right back to where you were before without reloading anything. Of course, you can choose to do this or not for any page and it super easy to set up. To do this you need to create a class implement RouteReuseStrategy from @angular/router. There are 5 methods you need to implement: shouldDetach, store, shouldAttach, retrieve, shouldReuseRoute. Let's take a closer look at these methods. shouldDetach shouldDetach ( route :  ActivatedRouteSnapshot ):  boolean When you go to the next page, this method will be trigged, it decides whether the current route (a page) should be detached. In other words, Angular takes a snapshot of it and saves it in memory ...

SEO with Angular, add title, meta keywords, a must-do thing for your website

  For those who don't know what SEO is, SEO stands for Search Engine Optimization, it helps people discover your site through search engines like Google, Bing, ... Take a look at the below picture: To let search engines discover your site, you must let search engines know your site, for google you can use Google Search Console  but that's another topic, I assume search engines already know your site. The 3 most important factors are URL, title tag, and meta tag (description, keyword,...). Search engines will look for those 3 things (and many other factors) to compare with the search query and decide whether your site is relevant or not. Url Try to use meaningful URLs. For example, instead of using a URL like https://yoursite.com/products/1 use https://yoursite.com/products/iphone or even better https://yoursite.com/iphone . You can achieve this by configuring your rooting modules. To make slug URLs you can strip accents your product names and join them with a hyphen (-). For e...

Create and deploy multi language (i18n) website with Angular 8+

This guide should work with Angular 8+.  In  this post: 1. Create an angular web project. 2. Set up i18n and translate. 3. Deploy the website on Windows using IIS. In this guide, I am using 2 languages, the setup for more than 2 languages should be similar. You can find the code of this guide in my github . 1. Create an angular web project. To create an angular app, in command  prompt type: ng new multiLanguageApp Open "app.component.html" delete the default code and paste this code : < div >    < a   href = "/" > de </ a > &nbsp;    < a   href = "/en" > en </ a > </ div > < div > Danke! </ div > Run "ng serve" to serve your app. Go to localhost:4200 you should see: I am creating an app with German as the default language and English as the second language. "Danke" is a word in German means "Thank you". When we click "de" or "en" in the UI to switch langu...