匹配所有非 www bbs 开头的域名,可以匹配 111.domain.com aaa.domain.com
RewriteCond %{HTTP_HOST} ^(?!www|bbs)([^.]+).domainname.com [NC] RewriteRule ^$ test.php?uid=%1 [QSA,L] 或者 RewriteCond %{HTTP_HOST} ^(.+)\.domainname.com$ [NC] RewriteCond %1 !^(www|bbs)$ RewriteRule ^$ test.php?uid=%1 [QSA,L]
test.php 这样写
print_r($_GET);