0
我有一個網站,我想有以下重定向:重定向到https幾乎工作,但不完全
1. http://mysite.net => https://www.mysite.com
2. http://www.mysite.net => https://www.mysite.com
3. http://mysite.com => https://www.mysite.com
4. http://www.mysite.com => https://www.mysite.com
我已經取得了1,2和3,但我有4煩惱一個,因爲「太多重定向」。這是我的htaccess:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com$ [OR]
RewriteCond %{HTTP_HOST} ^(www.)?mysite\.net$
RewriteRule ^/?$ "https\:\/\/www\.mysite\.com\/" [R=301,L]
# Use PHP5.3 as default
AddHandler application/x-httpd-php53 .php
# Send all traffic of main domain to subdirectory
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteCond %{REQUEST_URI} !^/sites/mysite.com/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ sites/mysite.com/$1 [L]
RewriteCond %{HTTP_HOST} ^(www.)?mysite.com$
RewriteRule ^(/)?$ sites/mysite.com/index.php [L]
任何幫助嗎?