问题描述
RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-dRewriteRule ^([a-zA-Z0-9_/]+)$ index.php/$1 [L]
目前用以上语句把 xxx.com/index.php/abc 简写为 xxx.com/abc
现在想在此基础上 abc.xxx.com 也同样可以访问 xxx.com/index.php/abc 请问该怎么写。
PS:我已经将abc.xxx.com的ip解析过去了
问题解答
回答1:RewriteCond %{REQUEST_HOST} (abc).xxx.comRewriteRule ^(.*)$ index.php/%1 [L]
正好最近在写这个, 注意用%1