I have to move a website that is currently hosted within the www root ($_SERVER['document_root']) of the hosting package to a subdirectory. Problem being that the scripting and the content of this website relies on the website being in the www root. Some urls used are relative to $_SERVER['document_root'] some urls used are hardcoded all over...
I thought my best option was to reset the PHP_FLAG $_SERVER['document_root'] via a htaccess to var/users/www/subdirectory/ but I don't think this is possible.
So now I'm thinking of placing an htaccess with a mod_rewrite. But I'm a newbie to this. I'll explain in PHP code what I'd like to do;
- Code: Select all
if(!ereg(^"subdirectory", $_SERVER['DOCUMENT_ROOT'])) {
$_SERVER['DOCUMENT_ROOT'] = "subdirectory/".$_SERVER['DOCUMENT_ROOT'];
}
Hope you guys get what I mean... Am very tired at this point :p
Cheers and thanx for ur time!