【发布时间】:2014-04-09 23:07:38
【问题描述】:
我想知道例如这个网站的 url 重写是如何工作的。我的意思是我不认为它是通过完成的。在 apache 或 nginx 中进行 modrewrite。我感兴趣的是 id 和用户友好的标题。如果服务器只输入 id 或标题错误的 id,它是如何工作的,它 301 将其重写为正确的?
有什么我找不到的方法吗?或者你能用一个小例子为我解释一下吗?
例如:
-index.php
|--index.php?page=2
-server.php?id=45343
-contact.php
-example.com/
|--example.com/page/2
-example.com/server/45343/some-random-title-to-be-user-friendly(.html)
-example.com/contact(.html)
.
更新:
我想知道在没有 modrewrite (htaccess..) 的情况下它是如何工作的,因为我知道例如xenforo 没有使用它。
【问题讨论】:
标签: php .htaccess mod-rewrite rewrite