Skip to content

Instantly share code, notes, and snippets.

@novasky-zz
Created October 29, 2013 11:30
Show Gist options
  • Save novasky-zz/7213002 to your computer and use it in GitHub Desktop.
Save novasky-zz/7213002 to your computer and use it in GitHub Desktop.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment