【发布时间】:2014-11-21 12:46:18
【问题描述】:
我必须编写一个 htaccess 来重写链接,如下所示,还有一个 404 的重定向 错误页面到我的网站根目录(主页)
www.example.com/index.php?page=find&name=detail&id=109&cid=8
www.example.com/index.php?page=find&name=detail&id=109
www.example.com/index.php?page=find&name=detail
www.example.com/index.php?page=find
应该改写成
www.example.com/find/name/detail/id/109/cid/8
www.example.com/find/name/detail/id/109
www.example.com/find/name/detail
www.example.com/find
【问题讨论】:
-
如果 URL 是
www.example.com/foobar应该是 404 还是www.example.com/index.php?page=foobar?
标签: apache .htaccess mod-rewrite url-rewriting http-status-code-404