你不能make动态子域.htaccess
您需要配置 apache 虚拟主机以接受多个域的请求
See the Apache 文档 - 使用基于名称的虚拟主机 http://httpd.apache.org/docs/current/vhosts/name-based.html#using
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com *.example.com
DocumentRoot /www/domain
</VirtualHost>
添加通配符子域*.example.com
,您的 PHP 应用程序将收到以下任何域的所有请求example.com
, ie garbage.example.com
, busted.example.com
, llama.example.com
, etc.
使用 Apache VirtualHost 创建通配符子域 https://stackoverflow.com/questions/13566226/creating-wildcard-sub-domain-using-apache-virtualhost
一台虚拟主机多个域 |通配符主机(共享主机)? https://stackoverflow.com/questions/621819/multiple-domains-to-one-virtual-host-wildcard-host-shared-hosting
Apache 多个域的默认虚拟主机 https://stackoverflow.com/questions/5831460/apache-default-virtual-host-for-multiple-domains
此时,您的应用程序必须确定子域的有效性并为未知子域显示相应的错误。
从那里,解析域mike
.