【发布时间】:2014-05-22 21:06:38
【问题描述】:
我想要动态子域,例如: (.*).mydomain.com
我可以用$_GET['subdomain'] 检索。我添加了一条通配符 DNS 记录 (* A xx.xx.xx.xx),现在对于我访问的每个子域(例如 test.mydomain.com),我得到的只是:
Apache is functioning normally
我在 .htaccess 中尝试过这段代码,但似乎没有任何帮助:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.mydomain\.com$
RewriteRule ^(.*)$ http://www.mydomain.com/?subdomain=%1 [L]
提前致谢!
【问题讨论】:
标签: php .htaccess dns rewrite subdomain