我有一个多博客网站,其中有多个域。问题是我需要以下语法的重写规则
XXX.domain.com/{any other things} to www.domain.com/domain/XXX/{any other things}
我也为下面的规则写了一套规则
^domain/([a-zA-Z0-9]+)/cat/([a-zA-Z0-9]+)$ index.php?domain=$1&cat=$2
因此,事情是我需要构建一条规则,将域转换为路径,然后再次按以下步骤处理其他事情。
在您制定其他规则之前,您需要
RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTP_HOST} ^([^.]+)\.
RewriteCond $1 !^domain/
RewriteRule ^(.*)$ /domain/%1/$1 [L]
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句