I'm trying to add dynamic parameters to my rewrite rule.. this is my attempt.
- Code: Select all
RewriteEngine On
RewriteRule ^([A-Za-z0-9_]+)/([^/.]+)?$ /TOMS/TestProject/index.php?page=$1&$2 [NC,L]
I want a url such as this -
/TOMS/TestProject/page/?key=val&key2=val2&key3=val3... etc
to point to -
/TOMS/TesProject/index.php?page=page&k=v&k2=v2&k3=v3... etc
It works fine on the 'index.php?page=page' part but putting that dynamic $_GET array in there just doesn't want to pick up ANYTHING..
[rant]
I've spent all morning and plenty of the last few days of my spare time trying to find posts, tutorials or anything about this but not found anything. I'm surprised it's not a common solution! (it probably is and I'm blind) I'm starting to think it's just a dumb idea all together... I have a feeling I've been staring it in the face with a number of 'Rewrite conditions' I've seen but I'm kinda new to the regex and modrewrite so things tend to drift past my recollection at times.. Anyway, anyone who can help would be a star! Or even some advice as to why I'm being a moron, maybe even telling me I'm so smart for trying so hard already, that'd be nice. Hmm..
[/rant]
-Tom