[英]WordPress URLs not ending with a slash redirect to HTTPs homepage
I have a mystery: for my blog,我有一个谜:对于我的博客,
http://yal.cc/about
) redirect to the HTTPS homepage ( https://yal.cc
) rather than the HTTPS version the URL. HTTP URLs that do not end with a slash (eg http://yal.cc/about
) redirect to the HTTPS homepage ( https://yal.cc
) rather than the HTTPS version the URL./about/
) redirect correctly. HTTP以斜线结尾的 URL(例如/about/
)正确重定向。/game-tools
) also redirect correctly. HTTP 对应于实际服务器目录(例如/game-tools
)的 URL 也可以正确重定向。http://ru.yal.cc/about
) also redirect correctly. HTTP 子域上的 URL(例如http://ru.yal.cc/about
)也可以正确重定向。.htaccess
) (子域是一个单独的 WordPress 安装在使用相同主题/插件/ .htaccess
的不同目录中) My .htaccess
is nothing unusual:我的.htaccess
没什么异常:
# BEGIN rlrssslReallySimpleSSL rsssl_version[4.0.7]
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
# END rlrssslReallySimpleSSL
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Things that I have tried to no success:我尝试过但没有成功的事情:
.htaccess
从.htaccess
删除真正简单 SSL 的重定向/%postname%
instead of /%postname%/
将永久链接格式更改为/%postname%
而不是/%postname%/
Where would I start with debugging this?我从哪里开始调试呢? This proves a mild inconvenience since most of the pre-2019 links to my website were http without trailing slashes, meaning that they are now broken without any way to indicate to the user that their subject of search is still there - a slash away.这证明了轻微的不便,因为到我网站的大多数 2019 年之前的链接都是 http 没有尾部斜杠,这意味着它们现在被破坏,没有任何方式向用户表明他们的搜索主题仍然存在 - 一个斜杠。
So, it's unclear which of the things listed in the question has helped, but I have apparently fixed it.因此,尚不清楚问题中列出的哪些内容有所帮助,但我显然已经修复了它。
If I were to guess, the original rule in .htaccess
was malformed and had been fixed while I was enabling-disabling it (which would have been prior to making a copy that's in the question) - I did undo the rest of the changes after (incorrectly) verifying whether they worked.如果我猜的话, .htaccess
中的原始规则格式不正确,并且在我启用-禁用它时已修复(这将在制作问题中的副本之前) - 我确实撤消了 rest 之后的更改(错误)验证它们是否有效。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.