Bob Crabb Posted August 27, 2009 Share Posted August 27, 2009 I am testing a site that I am planning to migrate from another hosting company. Since I have not yet changed the nameservers to point to TCH, I access the site via http://server.tchaddress.com/~accountid/ The problem is that all the php includes using the $_SERVER['DOCUMENT_ROOT'] variable resolve to /usr/local/apache/htdocs... and I get an error. Of course, I can edit the includes and remove the server document root variable while I am testing, but that is rather tedious. Can I redefine document root via .htaccess so that the addresses will properly resolve while I am testing the site? Quote Link to comment Share on other sites More sharing options...
SteveW Posted August 28, 2009 Share Posted August 28, 2009 My memory is a bit hazy on this, but I encountered the same thing when transferring my site. I think I recall doing a web search on it, discovering many webhost FAQ pages saying that PHP includes wouldn't work until the nameserver change is propagated, and concluding that there was no way around it and it wasn't worth trying to find a fix for testing purposes. Once propagation was complete, the PHP includes worked fine. I suspect it might be other aspects of the PHP transition that you're more concerned about and that you want to test more thoroughly, such as the TCH servers maybe being a different PHP version, with those potential complications. If it's any help, my nameserver change was propagated at my location within about 15 minutes, and at most locations in the world within about 2 hours, and I think after about 10-12 hours my old site never got another hit. So in spite of my worry about the potential 72 hour propagation time, it turned out that if I had found any disastrous problems with the transfer, I could have changed the nameserver info back, and the total downtime would have been pretty minimal. Quote Link to comment Share on other sites More sharing options...
Bob Crabb Posted August 31, 2009 Author Share Posted August 31, 2009 Steve, Thank you for the response. I switched the site over on Friday night, and everything worked fine. When I first saw the document_root problem when initially testing the site, I went to another of my sites, and accessed via the server name, ie servername.tchdomainname.com/~siteid , and saw the same thing happen. While testing, I just edited enough of the includes to be able to test a couple of pages, since a simple workaround was not apparent. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.