1
我想重定向站點ip到我的站點https
以及我想重定向非www網址到www
網址。我已經寫了這兩條規則,但它們是相互衝突的。這裏是我的凱德:在htaccess中衝突多個重定向規則
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#Redirect ip to site
RewriteCond %{HTTP_HOST} ^xx\.xx\.xxx\.xxx$
RewriteRule ^(.*)$ https://www.domain.pk/$1 [L,R=301]
#Redirect non-www to www
RewriteCond %{HTTPS_HOST} !^www\.
RewriteRule ^(.*)$ https://www.domain.pk/$1 [R=301,L]
</IfModule>
# END WordPress
http://stackoverflow.com/questions/17453412/redirect-to-http-non-www-to-https-www-htaccess – Damien
@Damien,個別情況下工作正常,但兩者共同,不工作 –
你的問題到底是什麼?你得到一個重定向循環或什麼? – starkeen