我的 .htaccess 中有以下规则:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www.)?annsenglishmediumschool.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?(.*).annsenglishmediumschool.com$ [NC]
RewriteCond %{REQUEST_URI} !^/index.php/shops
RewriteRule ^(.*)$ www.annsenglishmediumschool.com/index.php/shops/$1 [L]
RewriteCond %{HTTP_HOST} ^(www.)?annsenglishmediumschool.com$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
这显示在我在 cpanel 中的通配符重定向中:
Domain : (www.)?(.*).annsenglishmediumschool.com
和Redirect Url : www.annsenglishmediumschool.com/index.php/shops/
。我需要的是当用户键入时shops.annsenglishmediumschool.com
它应该重定向到annsenglishmediumschool.com/shops
。如何根据这个修改 .htaccess,在此先感谢。