mod_rewrite RewriteRule Question
Posted by: second_coming (---.pool1.Leeds-WYK2020-BAS0001.orangehomedsl.co.uk)
Date: November 09, 2009 11:29PM

Hi folks,

I have a few rewriterules setup but one of them isn't working as I think it should (though I'm probably wrong smiling smiley )

RewriteRule ^([^/]+)~([^/]+)~([^/]+)~([^/]+) index.php?section=$1&pg=$2&act=$3&order_no=$4 [L]
RewriteRule ^~([^/]+)~([^/]+) index.php?section=$1&pg=home&act=$2 [L]
RewriteRule ^([^/]+)~([^/]+)~([^/]+) index.php?section=$1&pg=$2&act=$3 [L]
RewriteRule ^([^/]+)~([^/]+) index.php?section=$1&pg=$2&act= [L]

The 2nd, 3rd and 4th rules all work perfectly but the first one only passes the variables $1,$2 & $3 to the php page not $4.

The link I am trying to rewrite is:

localhost/orders~upload~add~1912343

which I want to end up as:

localhost/orders/index.php?section=orders&pg=upload&act=add&order_no=1912343

Can anyone tell me what I'm doing wrong?

thanks

Options: ReplyQuote
Re: mod_rewrite RewriteRule Question
Posted by: yfastud (Moderator)
Date: November 10, 2009 02:29AM

did you already enable mod rewrite through wamp tray icon???

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: mod_rewrite RewriteRule Question
Posted by: second_coming (---.charlesworth.com)
Date: November 10, 2009 10:05AM

yes, the other rules are all working but the 1st one is passing the 1st, 2nd, 3rd variable but not passing through the 4th variable

Options: ReplyQuote


Sorry, only registered users may post in this forum.