.htaccess重定向到https://www. 子域除外

.htaccess重定向到https://www. 子域除外,.htaccess,http,https,subdomain,.htaccess,Http,Https,Subdomain,我需要将非www请求重定向到www。我还需要将http请求重定向到https。此外,我需要邮件子域不被重定向在所有 我的Magento站点上有以下代码。htaccess <IfModule mod_rewrite.c> Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L] RewriteRu

我需要将非www请求重定向到www。我还需要将http请求重定向到https。此外,我需要邮件子域不被重定向在所有

我的Magento站点上有以下代码。htaccess

<IfModule mod_rewrite.c>

Options +FollowSymLinks
RewriteEngine on

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]

RewriteRule ^api/rest api.php?type=rest [QSA,L]

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

RewriteCond %{REQUEST_METHOD} ^TRAC[EK]
RewriteRule .* - [L,R=405]

RewriteCond %{REQUEST_URI} !^/(media|skin|js)/

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

RewriteRule .* index.php [L]

</IfModule>
我需要添加一个例外,这样邮件子域就不会被重定向到。像mail.example.com这样的请求根本不应该被重定向

你能帮我做到这一点吗

RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L]