WordPress HTTP 请求 501 内部服务器错误

标签 wordpress http ssl https internal-server-error

您好,我有包含 Wordpress 的 digitalocean 一键式应用程序。 我将域添加到我的服务器并为我的服务器创建 SSL 证书。 https://example.com效果很好,但当我要求时 http://example.com它的重定向 -> http://myserverip.com并给出错误:


内部服务器错误

服务器遇到内部错误或配置错误,无法完成您的请求。

请通过 webmaster@localhost 联系服务器管理员,告知他们此错误发生的时间,以及您在此错误之前执行的操作。

服务器错误日志中可能提供有关此错误的更多信息。

此外,在尝试使用 ErrorDocument 处理请求时遇到了 301 Moved Permanently 错误。


请帮帮我。我尝试将 http 重定向到 https 但它不起作用! 这是我的 .htaccess 文件包含:

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]

# 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

最佳答案

试试这个,对我有用:

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

关于WordPress HTTP 请求 501 内部服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55081011/

相关文章:

php - 新站点未显示在移动 View 中

php - 如何从 WordPress 插件中的函数下载 CSV 文件?

javascript - Wordpress 中的谷歌图表

html - 如何将变量及其值发送到html

ssl - 无法将 Filebeat 连接到 Logstash

php - WordPress:wp_update_post 返回错误 "Allowed memory size exhausted"

delphi - 在 "Poodle"更改后让 Indy 调用与 Paypal IPN 一起工作

java - HTTP 服务器问题

jquery - Wordpress - "loading.gif"来自 "jquery.js"破坏 ssl 安全

ssl - 如何启用 tls 版本。 1.2 在 haproxy 中