How to Transfer Domain Names to Google Cloud Hosting
How to Transfer Domain Names to Google Cloud Hosting
One of the final steps before deploying your WordPress website on Google Cloud Platform is setting up a domain name.
With most hosting providers (such as SiteGround or BlueHost), setting up a domain name is relatively easy. However, setting up a domain name on the Google Cloud Platform is slightly more complicated.
Registering a Domain Name
Before starting this tutorial, you should’ve already purchased a domain name. Most .comdomains usually sell for around ten U.S. dollars. However, less commonly used domain names, such as those ending in .club or .site, sell for much cheaper. To register a domain:
- Visit a domain name provider (we recommend NameCheap).
- Search for the domain you want to purchase.
- Add it to your cart.
- Checkout.
Once you’ve registered a domain name and have setup WordPress on Google Cloud (Click-to-Deploy or Bitnami), you’re ready to start this tutorial.
There are 4 steps in this tutorial:
Additional Steps for WordPress:
1. Enable the Cloud DNS API
2. Create a Cloud DNS Zone
3. Add DNS Records
4. Configure NS Records
In this section of the tutorial, you will be pointing your domain name to your website on Google Cloud. In this example, NameCheap is used as the domain name provider, however, the process will be the similar for all domain name providers.
5. Edit WordPress URLs
5.1. WordPress Bitnami Instructions
Use the following instructions if you’re configuring the Bitnami version of WordPress on Google Cloud. For Click-to-deploy, scroll down to step 5.2.
sudo -i
nano /opt/bitnami/apps/wordpress/htdocs/wp-config.php
REPLACE THIS:
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
WITH:
define('WP_HOME','http://example.com');
define('WP_SITEURL','http://example.com');
Remember to replace “example.com” with either the www. or non-www. version of your domain name – whichever your prefer. For example:
define('WP_SITEURL', 'http://www.yourdomain.com/');
define('WP_HOME', 'http://www.yourdomain.com/');
If you’ve already configured SSL for your domain, you should substitute the http:// in the code above for https:// instead. For example:
define('WP_SITEURL', 'https://www.yourdomain.com/');
define('WP_HOME', 'https://www.yourdomain.com/');
Next, make sure to verify your website’s permalink structure. This setting often gets corrupted after changing your domain name settings. You can access your permalink settings by going to Settings > Permalinks.
5.2. WordPress Click-to-deploy Instructions
Use the following instructions to configure your WordPress URLs for the Click-to-deployversion of WordPress on Google Cloud.
That’s it!
Your domain name is now pointing to your Google Cloud website!
Remember – domain name changes can take up to 48 hours to take effect, but in my experience, they usually take less than 30 minutes.
If you have questions, follow along with the video for clarification.
Otherwise, leave your questions and comments below, and I will respond to them promptly.