【问题标题】:Wordpress HTTP Request 501 Internal Server ErrorWordpress HTTP 请求 501 内部服务器错误
【发布时间】:2019-07-31 12:52:44
【问题描述】:

您好,我有包含 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

【问题讨论】:

    标签: wordpress http ssl https internal-server-error


    【解决方案1】:

    试试这个,对我有用:

    <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>
    

    【讨论】:

    • 对不起还是一样:/
    • yoursite.com/wp-admin/options-general.php 下列出的站点 URL 是什么
    • Wordpress URL(https) => (example.com) |网站网址(https) =>(example.com)
    猜你喜欢
    • 1970-01-01
    • 2019-04-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-21
    • 2015-09-20
    • 2013-12-22
    相关资源
    最近更新 更多