Forum Moderators: phranque
Lets say the user enters:
"testhtml_pk-32_jg-55_psd-92.html"
And I want to redirect it to:
"display_page.php?pn=testhtml&pl=32&jg=55&psd=92"
So basically I want to tokenize on "_" and then split each token by the "-" and then create query string parms out of the elements.
I want to make it handle X number of tokens, so it should also be able to handle:
"testhtml_pk-32_jg-55_psd-92_abc-123.html"
"testhtml_pk-32_jg-55_psd-92_abc-123_xyz-987.html"
etc...
How can I do this?
Then split up $_SERVER['PATH_INFO'] on the slashes to get the pieces.
If you do that, there is no mod_rewrite needed.
At least with my setup, it knows display_page.php is a php program and /testhtml/pk-32/jg-55/psd-92.html is a PATH_INFO.
( note: $_SERVER['PATH_INFO'] still had not been documented )
Also, see the references in our forum charter [webmasterworld.com].
Jim