I have a script which creates urls like this:

domain.com/model/stoya-1.html
domain.com/model/sunny-leone-154.html
domain.com/model/kagney-linn-karter-1001.html

I need it to be like this:

domain.com/model/stoya
domain.com/model/sunny-leone
domain.com/model/kagney-linn-karter

The numbers are needed for database lookups, I was told, and there is also other types of urls on this domain which have numbers at the end, but I guess I would leave it as is (so only the ones with the /model/ in the url part, need to be rewritten).

All urls will be different, as 100% of the names will be unique.

I need to rewrite it, because I would like to use it with a php entry page, something like

domain.com/enter.php
domain.com/enter.php?model-name

and this "model-name" part would be getting redirected to:

domain.com/model/model-name

I guess it would be harder to do it with all these numbers at the end, and I know that it can be possibly rewriten.

Does anybody have an idea how this would work, if there are any implications to doing this, and what would be the best way to go?

Thanks.