Hi everybody! Interested in the question, can php create a third level domain? And if so, how? Thank :)

  • 2
    Php is not! With htaccess, yes! But it also depends on the host. Google, write to the hoster with this question! - Palmervan
  • Palmervan is right. Need to contact your hoster. - Iwww

2 answers 2

You can do this.

Register a type A record for all subdomains in your registrar setting, indicating one ip-address

*.example.com IN A xxxx 

where xxxx is the ip-address of your server. All that is needed now is to set up redirects so that the subdomains are redirected to the right place.

 Options +FollowSymLinks RewriteEngine On RewriteRule ^([aA-zZ0-9])$ handle.php?user=$1 

and

 RewriteCond %{HTTP_HOST} ^(^.*)\.example.com RewriteRule (.*) handle.php?user=%1 

Well, it is also possible to find a hoster that provides an API that allows you to write records dynamically.

    Through PHP there is no, subdomains are created through the control panel of the site hosting.