Jump to content

add subdomain script


Recommended Posts

Not with php, atleast I'm 90% sure you can't with php, unless you modify your apache config files, which you probably can't due to permissions issues..


what you CAN do, is contact your hosting provider, ask them to impliment wildcard subdomains..


and so whenever you go to




it'll know to go to whichever directory, in there you use modrewrite (htaccess rewrite engine) to detect the subdomain and reform the request to something similar to: yourdomain.com/whateverYouWant/

Link to comment
Share on other sites

Shared hosting? You can, but it's a hack. It involves cURL'ing into your cPanel and emulating what you'd do manually. I wouldn't suggest asking for help on this one, as the method will change with each host, and we can't test/debug without having access to your cPanel.


Are you running your own server? If so, it's much easier.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.