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

.htaccess AWS托管网站内WordPress站点中的http到https重定向,.htaccess,http,https,.htaccess,Http,Https,Https重定向在主网站上运行良好,但在博客上有问题。这些都不适合我 测试1 重新启动发动机 重写库/博客/ 重写条件%{HTTPS}关闭 重写规则^(.*)https://example.com/blog/$1[R,L] 重写规则^index\.php$-[L] 重写cond%{REQUEST_FILENAME}-F 重写cond%{REQUEST_FILENAME}-D 重写规则(.*)$/blog/index.php[L] 测试2 重新启动发动机 重写库/博客/ 重写条件%{HTTP

Https重定向在主网站上运行良好,但在博客上有问题。这些都不适合我

测试1


重新启动发动机
重写库/博客/
重写条件%{HTTPS}关闭
重写规则^(.*)https://example.com/blog/$1[R,L]
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则(.*)$/blog/index.php[L]
测试2


重新启动发动机
重写库/博客/
重写条件%{HTTPS}关闭
重写规则^blog/(*))https://example.com/blog/$1[R,L]
重写规则^index\.php$-[L]
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则(.*)$/blog/index.php[L]

您需要通过WordPress配置/设置进行如下配置well@hjpotter92我已经做到了,而且它也在发生。。。但问题是我得到的网站都是
http://example.com
https://example.com
如果我使用任何进一步的重定向,它会显示重定向的循环。您需要通过WordPress config/settings进行配置,如下所示well@hjpotter92我已经做到了,而且它也在发生。。。但问题是我得到的网站都是
http://example.com
https://example.com
如果我使用任何进一步的重定向,它将显示重定向循环
<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>
<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>