首先,你的拥有一个有泛域名解析的顶级域名,例如: domain.com
其次,在 httpd.conf 中打开 mod_rewrite
之后,在 httpd.conf 的最后,添加以下内容:
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteMap vhost txt:/usr/local/etc/apache/vhost.map
RewriteCond ${lowercase:%{SERVER_NAME}} ^(.+)$
RewriteCond ${vhost:%1} ^(/.*)$
RewriteRule ^/(.*)$ %1/$1
评论列表()