|
IntroductionIn the early days of web, when pages were static *.html files, there was a 1-1 relation (~mapping) between a URL path and the actual file path on the server. For example, if someone was asking for:
... the web server was actually serving It was mid 1998 when Apache 1.3, featuring the famous mod_rewrite module, gave webmasters the ability to decouple physical file structure from the URL path. Around the same time, PHP 3.x and server side scripting in general, were starting to transform the web into the dynamic medium it is today. The main entranceThe above straightforward design of serving requests is still alive and used by many popular dynamic systems. It is just that static *.html files are replaced with executable scripts. Unfortunately, this is like building a house, in the middle of nowhere, without outside walls and a main entrance. Since web visitors can arbitrarily execute whatever script they enter in the URL, developers must take an extra step to prevent this from happening. This is usually done as following:
There is another method for handling requests, which has its roots to the MVC design pattern and the related frameworks that were built upon it. It is known as Front Controller and refers to a single script that acts as a The Front Controller design offers the following benefits:
|