I’ve yet not found a very simple MVC framework. How do frameworks make it possible to access a controller by just an URL? I think it has got to do with the QUERY_STRING but isn’t it suppose to have a ??
http://localhost/public/controllername
and localhost/public is located at:
C:\wamp\www\public\
which contains an index.php
Generally, this is done through the use of
.htaccessrewrites (Apache mod_rewrite):.htaccessrewrites to direct every query that is not a static file to your main entry point, for exampleindex.php, assuming you use PHP as your server side language.index.phpand establish some routes in your application.Quick example:
.htaccessfile:index.phpfile:This, of course, is just a quick and rough example, but should give you an idea of how to do this.