wp config – How to stage a redesigned site on a new webhost while the original site is still live?


thanks in advance for any advice! My client has a live site currently hosted on GoDaddy. I am developing a redesigned site for him on Local. I don’t like working on GoDaddy and have advised him to move the new site to a new webhost when it’s time to take the new site live. I have set up a staging site on the new webhost so we can both easily make revisions to it. The new site is an entirely new entity with its own database, so I will not be migrating anything from the currently live site to it.

The new site has the same domain name as the original, live site. When the new site is ready I will point the DNS on GoDaddy to the new host. This is the first time I’ve tried this, and I’ve run into a problem.

Which is, that I can’t access or even log in to the staged site because the DNS still points to GoDaddy. I thought that installing a staged version of the new site in a subdomain on the new host server, and then using a temp URL to access it, would work, but sadly I’ve have found out it will not.

Tech support at the new webhost were stumped on how I could achieve this, but finally came up with the idea of creating a subdomain on the GoDaddy server and then pointing the subdomain DNS to the new webhost. I don’t like this idea, as I don’t want to take the slightest chance of interrupting or damaging the current live site.

I came up with what I hope is an elegant, simple solution, but I want to get opinions from people who may have tried it already and discovered if it works, or if it’s a totally stupid idea that is bound to fail.

I have added two lines to the wp-config file, for define( ‘WP_HOME’ and define( ‘WP_SITEURL’ and used the temp URL and directory location info of the new staging site. It seems to work just fine. Down the line, when the new site on the new host is ready to go live, I will point the DNS to the new host and delete the two lines in the wp-config file.

SO FINALLY to my question: Is this indeed a brilliant solution, or is there a real possibility it will it cause me major problems like broken links and database corruption in the future?

criz p. critter 1 year 2021-11-08T19:38:32-05:00 0 Answers 0 views 0

Leave an answer