Re:“Why are you using Node.js rather than PHP?”
by steveklabnik on Saturday May 25, 2013 @05:36PM
(#5768951)
Many PHP solutions rely on mod_rewrite to re-write URLs from the first to the second. Without those rewrite rules, you would get the second form.
[ Parent
| on HN ]
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.