mod_rewrite before of after developing application
I am trying to better understand how to incorporate mod_rewrite into a web applications development life cycle.
The question I am trying to understand is:
Do y开发者_StackOverflow中文版ou build your application and then setup mod_rewrite after the fact?
Is it more appropriate to consider mod_rewrite along the way while you develop your application?
mod_rewrite is a substantial part of your application. If it doesn't handle just trivial requests, but for example establishes a front controller, then of course you have to have planned your application structure to know what mod_rewrite is supposed to do.
Whenever I'm building an application - first thing what I do is to redirect any /foo/bar/ or /foo/bar.html into a PHP index.php?path=foo/bar. More detailed setup ( for example for images etc. ) I do when I need it
精彩评论