在web调试器中,301重定向页的html显示为:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://www.website.com
我刚刚切换到HTTPS。我之前将重定向设置为非www+无尾部斜杠+无文件扩展名。我已将重定向更改为HTTPS。我坚持将http non-www重定向到https non-www。http www到https non-www重定向工作正常。
我得到了以下代码,主要来自这里的答案。服务器为Apache 2.4.33 (Unix)
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
#example.com/page will display the contents of e