Wordpress 中的 .htaccess 问题在所有页面上出现 404

发布于 2024-11-29 03:26:04 字数 520 浏览 1 评论 0原文

我有一个 wordpress 多站点:

site1.local.loc [在我的本地有子域],我想在这方面有三个页面。

site1.local.loc/works - (帖子页面,但我希望“作品”作为我的标题)

site1.local.loc/about - (静态页面)

site1.local.loc/contact - (静态页面)

自“作品”以来是我不断添加内容的帖子页面,我将此网站的永久链接更改为:

/works/%postname%/

但是,当在发布任何内容结束时单击“查看帖子”时,它会将我引导至“404” '页面,这意味着存在断开连接。查看任何页面也是如此。我的 .htaccess 文件有问题吗?

我该如何解决这个问题?另外,如何使我的所有帖子出现在我的“作品”页面中(例如,如何使该页面成为帖子页面?)

谢谢!

更新:我发现为 WordPress 网络中的网站创建的任何页面都会收到 404 错误。

I have a wordpress multi-site:

site1.local.loc [with subdomains on my local] and I would like to have three pages on this.

site1.local.loc/works - (posts page, but I want 'Works' as my title)

site1.local.loc/about - (static page)

site1.local.loc/contact - (static page)

Since 'Works' is my posts page where I keep putting in content, I changed my permalinks for this site to:

/works/%postname%/

However, when clicking on 'view post' at the end of posting anything, it leads me to a '404' page which means there is a disconnect. This is also the case for viewing any page. Is my .htaccess file faulty?

How do I solve this? Also how do I make all my posts appear in my 'Works' page (as in, how to make that page the posts page?)

Thanks!

Updated: I've found out that I get a 404 for any page that I create for a site in a wordpress network.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

情归归情 2024-12-06 03:26:04

您不必触摸 .htaccess 文件。

创建一个名为作品的自定义帖子类型。所有以该自定义帖子类型发布的帖子都将具有您想要的 URL。没有其他办法可以做到这一点。 (即使有,它也一定是脏的)这是最简单的方式,并且由于 wp 自己完成它,所以您可以期望在更新、安装插件等时不会出现任何问题。

You do not have to touch .htaccess file.

Make a custom post type that is called works. All those posts made in that custom post type will have that url that you desire. There is no other way to do it. (even if there is, it must be dirty) That is celanest way, and since wp does it by itself you can expect that nothing will go wrong wnen you update, install plugins, etc.

杀お生予夺 2024-12-06 03:26:04

创建一个名为“Works”的类别,然后只需转到 /works/,即可显示添加到该类别的所有帖子,然后所有帖子将显示为 /works/post-name/。

您需要将永久链接结构更改为 /%category%/%postname%/

Create a category called "Works" that would then show all posts added to that category by simply going to /works/ all posts would then be shown as /works/post-name/.

You will need to change the permalink structure to /%category%/%postname%/

说不完的你爱 2024-12-06 03:26:04

在管理中检查这一点

设置>固定链接>帖子名称

Check this in administration

Settings > Permalinks > Post name

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文