Q:

Friendly URL with Apache Mod-Rewrite

Been reading about this for a while now and I'm close but struggling with the final hurdle.
I have a url like this: 
site.com/detail/123/some-description/maybe-some-more-description
that I want to become
site.com/details.php?id=123 
I've got this so far 
RewriteRule detail/(.*)/.*$ details.php?id=$1

which according to this (https://htaccess.madewithlove.be/) results in
details.php?id=123/some-text
how do I get rid of the some-text on the end?

A:

Try this:

The regex: (.*?detail)\/(\d+)\/.*
The replacement: $1.php?id=$2

Which results in site.com/detail.php?id=123.
They both can be tested at Regex101. 

(.*?detail) matches the site base URL with details and captures to the group $1.
\/ matches the slash itself (must be escaped).
(\d+) matches the number and captures it to the group $2.
\/.* matches the rest of the URL and it helps to not include it in the replacement.

Edit: Do you mind the difference between detail and details?

