Search code examples
phproutesnamingfront-controllerfastroute

What are these routing styles called in a web application?


What do you call routing that maps one URL directly to a file?

Example:

http://localhost/directory/file.php => /var/www/apache/htdocs/directory/file.php

What do you call routing like one on https://github.com/nikic/FastRoute?

Example:

http://localhost/directory/file => request actually goes to a single index.php file, which then loads routing files or tables and loads appropriate class as defined in the routing table.


Solution

  • What do you call routing that maps one URL directly to a file?

    I would call that no routing. Or maybe direct routing? I've never heard anybody use a term specifically for it.

    What do you call routing like one on https://github.com/nikic/FastRoute?

    That's (typically) the front controller pattern.