I am completly new to htaccess, never have to do it on my own. But its time.
I have a simple PHP API, so I need redirect all urls to index.php (PHP will handle routing), so
localhost/api/user
localhost/api/post
localhost/api/whatever
Goes to
localhost/index.php
This is quite simple i gues?
RewriteRule (.*) /api/index.php
But than I need one more thing and thats, when the last sequence of url is number like:
localhost/api/user/142
localhost/api/post/675
localhost/api/whatever/2136912
It Should Go to Goes to
localhost/index.php?id=GIVEN_NUMBER
Is there even a way to do that, or should I start work on PHP solutiuon? Thanks