php 實(shí)現(xiàn)二級(jí)域名的解析指向
htaccess 可以實(shí)現(xiàn)不需要phpOptions FollowSymLinksRewriteEngine On#測(cè)試子域名RewriteCond {SERVER_NAME} ^(www.)?sub
htaccess 可以實(shí)現(xiàn)不需要php
Options FollowSymLinks
RewriteEngine On
#測(cè)試子域名
RewriteCond {SERVER_NAME} ^(www.)?subdomain.mydomain.com [NC]

RewriteCond {REQUEST_URI} !^/subdomain/ [NC] #重定向到子目錄

RewriteRule ^(.*)$ subdomain/$1 [L]