Last Updated: February 25, 2016
·
799
· dubrod

Dynamic subdomains with cPanel and PHP

Put * in Subdomains in cPanel to setup Wildcard

Put this in .htaccess

Options +FollowSymLinks

RewriteEngine On
RewriteRule ^([aA-zZ])$  subslug.php?username=$1

RewriteCond %{HTTP_HOST} ^(^.*)\.yourdomain.com
RewriteRule (.*)  subslug.php?username=%1