如何解决WordPress 永久链接仅适用于 URL 中的 index.php
当我尝试更改 WordPress 永久链接设置时,帖子和页面的链接返回 404 页面。我发现让它们工作的唯一方法是使用普通永久链接或在我的永久链接 url 中包含 /index.php/,例如 domain.com/index.php/postname。如果 index.php 不是 URL 的一部分,我如何让它们工作?
我的 .htaccess 在下面,我也使用了 https://wordpress.org/support/article/using-permalinks/#creating-and-editing-htaccess 中建议的 .htaccess,但是对永久链接的更改会将下面的代码放回到 htaccess 文件中。我的 Apache 服务器上启用了 Mod_rewrite。
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。