Welcome to WebmasterWorld Guest from

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Mod rewrite question

Handling tokens in url?



1:26 pm on Sep 29, 2006 (gmt 0)

10+ Year Member

I have a question on if and how I can do the following rewrite.

Lets say the user enters:

And I want to redirect it to:

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:

How can I do this?


2:55 pm on Sep 29, 2006 (gmt 0)

5+ Year Member

I have url done like

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 )


6:50 pm on Sep 29, 2006 (gmt 0)

10+ Year Member

Well, I guess I could do something similar to that, but I really prefer to use mod rewrite so that all of my query parms show up in the php $_REQUEST object.

Anyone know how I can do this with mod_rewrite?


7:05 pm on Sep 29, 2006 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member

This thread [webmasterworld.com], in the Apache forum section of the WebmasterWorld library [webmasterworld.com], may prove helpful to you.

Also, see the references in our forum charter [webmasterworld.com].



Featured Threads

Hot Threads This Week

Hot Threads This Month