dsfhe34889789708 2012-04-09 19:43
浏览 99
已采纳

在PHP中映射路由的最简单方法

I was browsing Symfony's website. I didn't really feel like I need all the functionality the framework offers, but I did like the routing part. It allows you to specify URL pattern like this

/some/path/{info}

Now for URL like www.somewebsite.com/app.php/some/path/ANYTHING it would allow you to send client a response specific for this URL. You could also use string ANYTHING and use it similar as GET parameter. There is also option to hide app.php part of the URL which leaves us URL like www.somewebsite.com/some/path/ANYTHING. My question is what's best approach to do this without a complex framework?

  • 写回答

3条回答 默认 最新

  • douchenchepan6465 2012-04-09 19:59
    关注

    I recommend this article http://net.tutsplus.com/tutorials/other/a-deeper-look-at-mod_rewrite-for-apache/ to understand url rewrite using apache mod_rewrite you do not need any framework just php. Also this is what in the depth any framework implements

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?