wordpress - 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文件。Mod_rewrite 在我的 Apache 服务器上启用。
# 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
解决方案
推荐阅读
- text - SSIS 导入奇数文本文件
- c# - JSON 到自定义对象层次结构
- javascript - 如何在特定条件下使用猫鼬获得不同的对象?
- java - Beam WordCount Docker 映像无法在 Flink Runner 上启动,但 AvroCoderregistrar 不是 SubType 异常
- .net-core - 'reportgenerator' 不是内部或外部命令、可运行程序或批处理文件
- python - 如何在熊猫中未选择的情况下获取行?
- python - 做一个负数正python
- r - 如何将单个列表转换为 R 中用于大数据的组合数据框?
- dask - 从自定义多处理解决方案迁移到 dask
- vue.js - 创建 vue.js 全局函数