I was wondering why every framework is using there own http routing and not using for example apaches mod_rewrite
.
In frameworks like larave, symfony etc. there redirect every request to index.php
and routing happens using php.
$app->get('/foo/:id', 'FooController@fooMethod');
Why is that? You could use apaches mod_rewrite to do the same thing and probably would be faster than using a php router.
RewriteRule ^/foo/(\d+)$ index.php?action=FooController@fooMethod&id=$1
What are the pros and cons using a own php router? Is using standard mod_rewrite for routing considerd bad practice?