I'm currently using the following line to convert /pages/group/index.php?id=1&slug=example-name
into group/1-example-name
which works perfectly and I can retrieve the ID and slug using $_GET
but when I try to add an additional parameter for the page number, I cannot retrieve the page number and it becomes part of the slug.
Two parameters
RewriteRule ^group/([^-]*)-([^.]*)$ /pages/group/index.php?id=$1&slug=$2 [L]
Additional third parameter
RewriteRule ^group/([^-]*)-([^.]*)/([0-9]+)$ /pages/group/index.php?id=$1&slug=$2&page=$3 [L]
So if the ID parameter is 1, the slug parameter is hello-example and the page parameter is 10 - the ID will return perfectly but the slug will return as hello-example/10 and the page number will return as empty.
Any help would be much appreciated :)!