http到AWS托管网站内的WordPress站点中的https重定向

时间:2016-10-14 13:27:54

标签: .htaccess http https

Https重定向适用于主网站,但有博客问题。其中任何一个对我都不起作用。

测试1

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/

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

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ /blog/index.php [L]
</IfModule>

的Test2

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/

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

RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*)$ /blog/index.php [L]
</IfModule> 

0 个答案:

没有答案
相关问题