I have reviewed similar questions on SO and cannot find one that fits my needs so this is not a duplicate.
I have a simple php page called top.php. I pass a parameter in the url like so: top.php?n=100.
In my .htaccess file I use mod_rewrite to change the url to top-100. Simple. But what I want to do is not have to hard code every possible url for any number passed as a parameter. Let me elaborate:
top.php?n=5 | rewrite to top-5
top.php?n=3 | rewrite to top-3
top.php?n=10 | rewrite to top-10
And so on.
So how do I create a rewrite using the query string parameter to dynamically generate the friendly url?
top.php\?n=([0-9]+) | top-$1