I’m interested to create subdomains on the fly directly from php. For example when an user create a new page I want that page to be newpage.mydomain.com. Is that possible without changing the php or apache configuration files (supposing I’m using a shared hosting account).
Later Edit: I’m talking about my domain, and I have full access to the domain administration area.
Set up an error document in your .htaccess file that redirects every single 404 to a file called maybe redirection.php. This .php file is what will handle the “on the fly” redirects.
Add a wildcard DNS record in your zone files, so that [whateverhere].yourdomain.com points to the IP of your webserver
Add a wildcard serveralias in your apache configs by using:
ServerAlias *.yourdomain.com
Write the following code in your redirection.php file.
.
Does this help a bit?