I have the following mod_rewrite rule:
RewriteRule ^([^/.]+)/?$ search.php?action=procedure&procedureName=$1
This works fine in redirecting things like /blabla to /search.php?action=procedure&procedureName=blabla
The problem is that sometimes I want to pass a 'start' value (for pagination). For example, /blabla/?start=20.
Currently, it just ignores it. Printing out the $_REQUEST array doesn't show 'start'. I tried modifying the rule to:
RewriteRule ^([^/.]+)/\?start=([0-9]+)$ search.php?action=procedure&procedureName=$1&start=$2
RewriteRule ^([^/.]+)/?$ search.php?action=procedure&procedureName=$1
But it didn't do anything.
Any idea?
Thanks
RewriteRule ^([^/.]+)/?$ search.php?action=procedure&procedureName=$1 [L,NC,QSA]
The QSA means query string append, and it'll append $_GET vars you pass. Otherwise, they are normally not added.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With