您好我有digitalocean一键应用程序包含Wordpress。我将域添加到我的服务器并为我的服务器创建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>