Keywords: WordPress - Google Cloud Platform - How to - Application configuration
Foremost, please pardon me for not using the right technical jargon to explain the situation.
I have issues with IP and domain name conflicts in server configuration.
Below lists some of the problems:
- Google Search has cached the server’s external IP instead of the domain name
- Google Merchant Center reported errors of url contains IP instead of domain name
- Some theme/plugins point to the server’s external IP instead of the domain name
What I have done to change IP to domain name:
I have used plugins such as Better, Search Replace and String locator to change all IP to domain.
In the database, I have updated the siteurl and home to
sudo mysql -u bn_wordpress -p -e "USE bitnami_wordpress; UPDATE wp_options SET option_value='http://example.com' WHERE option_name='siteurl' OR option_name='home';"
I’ve confirmed that the website URL is correctly updated from Admin Panel > Settings > General It shows
- I updated the wp-config.php from
define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST'] . '/'); define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST'] . '/');
define('WP_SITEURL', 'http://example.com/'); define('WP_HOME', 'http://example.com/');
Step 3 ultimately breaks the website. The site breaks once the wp-config.php is updated.
Some additional info:
- The web server is attached to a load balancer
- Using load balancer to handle HTTPs. There is no SSL installed on the server level.
- The domain name is fully resolved.
- There is no issue with the website’s functionality other than the IP/domain name conflicts