2011-07-15 15:10 阅读 53


I did not find a better title if you have a better one please correct me.

My web application root looks like this:

- Controllers
-- User
--- Settings
--- Profile
-- Page
--- Edit
--- Show
- objects (models)
-- User
-- Page
- templates (views)
-- User
--- Settings

Now My Question is should i create a index file that handles everything?

Real URL -> mod_rewrite URL

index.php?module=user&action=settings  ->  /user/settings/

Or let mod_rewrite handle everything?

Controllers/User/Settings.php  ->  /user/settings/

I mean with a index file it's much comfortable, but which one is faster? also which one is faster under high traffic?


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享

1条回答 默认 最新

  • 已采纳
    doubinei1457 doubinei1457 2011-07-15 15:20

    The performance differential will be microscopic for any but the highest traffic apps, and doing your routing in PHP instead of mod_rewrite will be easier to maintain and more flexible.

    点赞 评论 复制链接分享