【发布时间】:2021-07-26 22:09:54
【问题描述】:
考虑以下帖子类型
-
Posts(在 WordPress 中默认) -
Accessories(自定义帖子类型)
我想让posts 转到/blog。 Accessories slug 已定义为 /accessories。
为此,在settings > permalinks > 中将我的custom structure 定义为/blog/%postname%/。
这样,当我转到 /blog/ 时,我得到一个 404。但是,当我在 posts 中创建帖子时,permalink 显示为 /blog/test-title。
另外,使用custom structure 设置,当我尝试转到/accessories 时,它也是404。
问题:
- 为什么
/blog404?它应该使用index.php作为它的模板,不是吗? - 为什么
/accessories404 有这个变化? - 如何让
/blog和/accessories工作?
【问题讨论】:
-
这是一个常见的错误。我相信它会有所帮助:-wordpress.stackexchange.com/questions/123387/…
标签: wordpress mod-rewrite url-rewriting permalinks