Im programming a where every users can creates their own subdomains. My host require me to create a new dir in the basedir for every subdomain I want to have.. So my sollution was.. when a user creates a subdomain than a directory with an indexfile will be created. Then I add these rows into the indexfile(index.php): <? $path = dirname(dirname(__FILE__)); set_include_path(get_include_path() . PATH_SEPARATOR . $path); include("user_index.php"); ?> So.. the user_index file is one dir below.. but when I try to get the url name of the file($dir_name = __FILE__; ) than it prints out the filename for the user_index instead of the filename of index.php.. Iam confused.. Is there a better way to manage subdirectories??