[b]Intro:[/b] I have a server configuration that assigns folders as subdomains through DNS. When you FTP the files, you use the folder, but when you view them, you use that folder name as a subdomain - Like this: [code]http://www.website.com/subdomain[/code] translates to: [code]http://subdomain.website.com/[/code] You can also access the subdomain folder through the browser like you do with the FTP. Because of this subdomain configuration, a package I'm using is getting a bit confused when reading out php server variables. I've changed the configuration in the software so that it mostly works, however, still have 1 problem, which I've identified to this: [code]if(!isset($_SESSION['ccAdmin'])){ header("Location: ".$GLOBALS['rootRel']."admin/login.php?goto=".currentPage()); exit; // check session path is correct } elseif(strpos(dirname($_SERVER['PHP_SELF']), $_SESSION['AdminPath']) !== 0){ header("Location: ".$GLOBALS['rootRel']."admin/login.php?goto=".currentPage()); exit;[/code] What I believe this code does is create a record of where the user was so that when re-authenticating themself, the software returns to that page. I could be wrong about this (Limited php knowledge), but that isn't the problem anyway. [b]Problem:[/b] From currentPage, I'm getting this result: [code]subdomain/admin/index.php[/code] when I should be getting just... [code]admin/index.php[/code] How can I strip out the subdomain folder from that currentPage result?