Forum Moderators: phranque

Message Too Old, No Replies

rewrite variable not passing to the page

redirect works but variable is not passed

         

phparion

11:38 pm on Oct 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi,

i have a rewrite rule as follow

RewriteRule ^feeds/view-feed/[0-9]/$ index.php?controller=feed&view=viewFeed&feedID=$1 [L]

this rule redirects URLs like

example.com/feeds/view-feed/3/

index.php gets all variable values correctly but only feedID is passed as blank that is $1 does not pass "3" for this URL.

I tried many different digits in place of 3 but it has the same problem.

why is behaving like that? thank you

g1smd

11:59 pm on Oct 20, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Using
^feeds/view-feed/[b]([/b][0-9][b])[/b]/$
would capture the back-reference.

phparion

12:41 am on Oct 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



arrrgghhh!

thank you very much!

g1smd

9:11 am on Oct 21, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



It is the simplest of things that get over-looked.

I do it all the time. :)