Forum Moderators: phranque

Message Too Old, No Replies

Mod_Rewrite Multiple Params

Multiple Params

         

jmt0806

1:19 pm on Apr 15, 2004 (gmt 0)

10+ Year Member



I have researched through SEs and this forum but could not find a solution to this problem:

I would like to use mod_rewrite for multiple params in a PHP URL. This is what I have (does not work):

RewriteRule ^baby_category_new1_(.*)-(.*)-(.*)-(.*)\.html$ /baby_category_new1.php?cat=$1&page=$2&limit=$3&viewall=$4 [L]

The URL should go from:

baby_category_new1_top_gifts_1-0-10-yes.html

to

baby_category_new1.php?cat=top_gifts_1&page=0&limit=10&viewall=yes

Thanks in advance for any help

Birdman

1:38 pm on Apr 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hmmm. It looks correct to me. What type of error(if any) do you get. Did you turn the rewrite engine on?

RewriteEngine on
RewriteRule ....

Regards,
Birdman

jmt0806

2:03 pm on Apr 15, 2004 (gmt 0)

10+ Year Member



The rewrite seems to be working now, however is there a way to specify if a different number of params might be in the URL?

Ex.

baby_category_new1_top_gifts_1-0.html

or

baby_category_new1_top_gifts_1-0-10.html

jdMorgan

2:29 pm on Apr 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



jmt0806,

Welcome to WebmasterWorld [webmasterworld.com]!

This was discussed a few days ago. See [webmasterworld.com...]

Jim