What I need is for each siteload to be on any random subdomain. If my site is www.domain.com then each time I visit www.domain.com/xyz , the url should be something like abc.domain.com/xyz then dfg.domain.com/xyz and so on basically random.domain.com/xyz Any help would be appreciated.
1) Create folder in your domain.com, called xyz. 2) Inside that folder, create an index.php with the following code: $domain_name = 'phptricks.com/xyz'; $list_subdomains = array('abc','dfg'); srand((double)microtime()*1000000); $random = rand(0,count($list_subdomains)-1); header("Location: http://".$list_subdomains[$random].$domain_name); exit(); PHP: Peace,
I dont understand php, but I assume that the code will create a cotainer with my specified subdomain names, ie. abc ,dfg and so on. then it will progessively change my subdomain name? Can you change the code and make it completely random, ie instead of me specifying a list of subdomains, the code will generate a random alphanumeric subdomain each time?