Having another issues trying to move a site up on to my live Host. Seems "RootURL" is not being set correctly.
Site is working fine on localhost.
I'm using the the following code, taken from index.php to check what settings are being retrieved.
$rootPath = dirname(__FILE__); if(DIRECTORY_SEPARATOR != '/') $rootPath = str_replace(DIRECTORY_SEPARATOR, '/', $rootPath); $rootURL = isset($_SERVER['HTTP_HOST']) ? substr($rootPath, strlen(rtrim($_SERVER['DOCUMENT_ROOT'], '/'))) . '/' : '/';
I've just added some debug code to it and uploaded it to my test server.
The new code is
<?php $rootPath = dirname(__FILE__); echo "RootPath:".$rootPath."</br>"; if(DIRECTORY_SEPARATOR != '/') $rootPath = str_replace(DIRECTORY_SEPARATOR, '/', $rootPath); echo "NewRootPath:".$rootPath."</br>"; echo "HTTP_HOST:".$_SERVER['HTTP_HOST']."<br/>"; echo "DOCUMENT_ROOT:".$_SERVER['DOCUMENT_ROOT']."<br/>"; $rootURL = isset($_SERVER['HTTP_HOST']) ? substr($rootPath, strlen(rtrim($_SERVER['DOCUMENT_ROOT'], '/'))) . '/' : '/'; echo "RootURL:".$rootURL; ?>
on my localhost the output is :
RootPath:C:\xampp\htdocs\www.tsp.com NewRootPath:C:/xampp/htdocs/www.tsp.com HTTP_HOST:localhost DOCUMENT_ROOT:C:/xampp/htdocs RootURL:/www.tsp.com/
While on my live server I'm getting the follwoing:
RootPath:/content/Hosting/d/i/digimute.com/subdomains/lab/web NewRootPath:/content/Hosting/d/i/digimute.com/subdomains/lab/web HTTP_HOST:lab.digimute.com DOCUMENT_ROOT:/content/Hosting/l/a/lab.digimute.com/web RootURL:ins/lab/web/
Check out the RootURL ??
Where is it getting this from ??
Anyone any clues?
Thanks for the help.
Mike.













