2

我注意到在 WordPress 网站中重写 URL 后,我可以使用两个 URL 访问相同的内容:

http://example.com/category/article-name-here/primary_key

http://example.com/category/article-name-here

这两个 URL 都将指向完全相同的内容。它背后的确切逻辑是什么,文章名称本身是唯一的吗?

我正在创建一个具有相同 URL 结构的启动站点。但我不能拥有相同unique-article-name的 .

4

2 回答 2

1

看看这篇文章:

http://codex.wordpress.org/Using_Permalinks

它说

In the Settings → Permalinks panel (Options → Permalinks before WordPress 2.5), you can choose one of the "common" structures or enter your own in the "Custom structure" field using the structure tags.

于 2013-10-15T03:57:35.527 回答
0

Wordpress 使用称为路由器的东西,它也是许多框架(尤其是MVC 框架)的一部分,用于根据 URL 确定要显示的内容。例如,它可能会在数据库中查找某些内容(例如,已重命名的旧页面),然后根据该内容显示内容,或者它可能仅在服务器上查找文件,如果没有,则显示 404 页面。找不到它。

基本上,研究与PHP 框架相关的路由,以了解整个逻辑是如何工作的。

于 2013-10-15T03:59:00.177 回答