Pretty URLs for search pages

后端 未结 6 2103
隐瞒了意图╮
隐瞒了意图╮ 2020-12-01 13:31

I really enjoy having \"pretty\" URLs (e.g. /Products/Edit/1 instead of /products.aspx?productID=1) but I\'m at a loss on how to do this for pages

6条回答
  •  无人及你
    2020-12-01 14:11

    The MVC (Model View Controller) framework is designed specifically to tackle this issue. It uses a form of url rewriting to redirect actions to pages and provides just the functionality you're looking for. It makes handling pretty urls a breeze.

    With regard to the length of URLs, id still use pretty urls but a particularly long URL may be an indication that you may want to reconsider your grouping of the items, alter the classification if you will so Products/{NAME}/{Address} without intermediary url parts.

    Examples of the MVC framework can be found at:

    .Net - http://www.asp.net/mvc/

    PHP - http://www.phpmvc.net/

    Java - http://struts.apache.org/

提交回复
热议问题