ipwnzphp Posted July 18, 2007 Share Posted July 18, 2007 I fount this tut on webhostingfreaks and it dont seem to work all that good. Can anyone help out here? 1. Set up an error document in your .htaccess file that redirects every single 404 to a file called maybe redirection.php 2. Add a wildcard DNS record in your zone files, so that [whateverhere].yourdomain.com points to the domain IP. 3. Add a wildcard serveralias in your apache configs by using: ServerAlias *.yourdomain.com 4. Write the following code in your redirection.php file <? $url=$_SERVER["REQUEST_URL"]; $newurl=str_replace(".yourdomain.com","",$url); $newcomplete="http://yourdomain.com/".$newurl; Header("Location: ".$newcomplete); ?> So when someone enters a subdomain, let's say myself.yourdomain.com they get redirected to yourdomain.com/myself. Iam trying to say like if somone goes to http://www.username.mysite.com it will pull the id form this link user_system/profile.php?pg=view&id=1114 on the $_GET['id'] do a mysql than pull the username back and then make the subdomain. Quote Link to comment Share on other sites More sharing options...
Daniel0 Posted July 18, 2007 Share Posted July 18, 2007 It's not possible. The subdomain has to be created before it can be accessed. You could create the subdomain when the user registers though. I believe cPanel has some sort of API which you can use for this, but I think you need access to it's WHM to use it. Quote Link to comment Share on other sites More sharing options...
ipwnzphp Posted July 18, 2007 Author Share Posted July 18, 2007 should be able to make it somehow. It can be done anything can be done. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.