3 ms·
Because PHP doesn't implement the web server itself but instead relies on Apache/Nginx/whatever, it has to use the info the server provides for routing. Once yo
by Udo 13y ago
Because PHP doesn't implement the web server itself but instead relies on Apache/Nginx/whatever, it has to use the info the server provides for routing. Once you configure the server to pass this information along, there is really not a lot of difference how routing takes place inside the web app.
Of course, there are a lot of sites that use .htaccess to implement routing rules, but I'm not a huge fan of that. All things being equal, I believe just passing the virtual path to an /index.php endpoint is preferable - and it's pretty much what other languages and frameworks do in these cases as well.