我将我的 Wordpress 站点的 url 更改为使用“https://”,当在“设置”>“常规选项”以及 .htaccess 文件中添加更改时,我在服务器上返回内部错误。
apache 日志有以下信息:
[Wed Oct 03 07:29:10 2018] [error] [client 177.73.98.2] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., Referer: https://meusite.com.br/
我的 .htaccess 我将以下规则用于强制 SSL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^ index \ .php $ - [L]
RewriteCond% {REQUEST_FILENAME}! -F
RewriteCond% {REQUEST_FILENAME}! -D
RewriteRule. /index.php [L]
RewriteEngine On
RewriteCond% {SERVER_PORT} 80
RewriteRule ^ (. *) $ https://meusite.com.br/$1 [R, L]
</ IfModule>`
最佳答案
不要更改您的 .htaccess
文件。
您遇到此问题的原因是因为 WordPress 管理中的 WordPress 地址 (URL)
和 站点地址 (URL)
设置仍然指向 http
您的 URL 版本。
发生的事情是,当访问者访问您的网站时,.htaccess
规则将他的请求重定向到 https
版本,然后加载 WordPress,它识别出设置指向 http
版本,从而触发重定向到 http
版本。此重定向再次被 .htaccess
规则捕获并一直持续到超时。
你需要做什么:
1. 删除对 .htaccess
文件的任何修改。
2. 在您的 Wordpress 管理员中更新 WordPress 地址 (URL)
和 站点地址 (URL)
,将它们指向 https
版本的 URL。< br/>
3. 安装WordPress HTTPS (SSL) Plugin
关于php - Wordpress SSL - 请求超出了 10 个内部重定向的限制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52625968/