0

我的 .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,在此先感谢。

4

1 回答 1

0
RewriteCond %{HTTP_HOST} shops.annsenglishmediumschool.com
RewriteRule .* http://annsenglishmediumschool.com/shops [L]

只需将其添加到您的 .htaccess 文件之前</IfModule>

于 2013-05-07T09:22:35.040 回答