首页 > 解决方案 > 安全 URL 是使用 WordPress 返回 ERR_TOO_MANY_REDIRECTS

问题描述

为什么安全 URL 使用 WordPress 返回 ERR_TOO_MANY_REDIRECTS?

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]
</IfModule>

# END WordPress

标签: phpwordpress.htaccess

解决方案


.htaccess为 wordpress 子目录文件夹添加文件。

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
RewriteRule ^(/)?$ index.php [L] 
</IfModule>

推荐阅读