The most simple way would be (in .htaccess
, in your server configuration or in your vhosts configuration):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]
This will forward all your requests that do not match a file, a directory or a symbolic link to your index.php
. In there you can inspect the request URI to determine what to do. In fact you will need some kind of dispatcher that knows how to deconstruct the URL to determine what action should be taken. In fact this could result in some MVC implementation - but that's not a requirement.