htaccess – 通配符子域到子文件夹
所以这个想法是我有: domain.com/.subdomains/domain1 (2,3,4,etc) 而我想映射: domain1.domain.com -> domain.com/.subdomains/domain1/ domain2.domain.com -> domain.com/.subdomains/domain2/ 但是我希望它忽略“www” 我这样做是半成功的: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^(.*)\.domain\.com [NC] RewriteRule ^(.*)$ http://domain.com/.subdomains/%1/$1 [NC,QSA,L,P] 有两个问题: 1)它不会忽略“www” 2)当我去到URL: http://domain3.domain.com/deep/subfolder/here/index.html 它将我redirect到: http://domain.com/.subdomains/domain3/deep/subfolder/here/index.html 我一直在试图find答案,但我找不到任何其他人有这个问题。 有任何想法吗? 谢谢! 编辑: 好吧,似乎我不能使用http,但如果我改变 RewriteRule ^(.*)$ http://domain.com/.subdomains/%1/$1 [NC,QSA,L,P] 至 RewriteRule ^(.*)$ /.subdomains/%1/$1 [NC,QSA,L,P] 它进入一个奇怪的redirect循环