create subdomains with .htaccess

Dynamic subdomains using htaccess

This will render abcd.yourwebsite.com into yourwebsite.com/wor_out.php?url=abc

RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.yourwebsite.com
RewriteCond %{HTTP_HOST} ([^.]+)\.yourwebsite.com
RewriteRule ^(.*)$ /path_to_your_site/httpdocs/work_out.php?url=%1
[ad code=2 align=center]

Leave a Reply