MAVERICK
asked on
Apache mod_rewrite question
Hi Everyone,
I'm trying to make a rule to return more than one variable for the rewrite.
http://www.devserver.local/product.AB1234.htm?Affiliate=maverick
This one works except nothing gets returned in $2
RewriteCond %{QUERY_STRING} Affiliate=(.*)
RewriteRule ^product\.(.*).htm http://miva.devserver.local/Merchant2/merchant.mvc?Screen=PROD&Store_Code=EFY&Product_Code=$1&Affiliate=$2 [R,L]
This doesn't work
RewriteCond %{QUERY_STRING} Affiliate=(.*)
RewriteRule ^product\.(.*).htm(\?.*) http://miva.devserver.local/Merchant2/merchant.mvc?Screen=PROD&Store_Code=EFY&Product_Code=$1&Affiliate=$2 [R,L]
Can someone explain what I've done wrong.
Regards
Maverick
I'm trying to make a rule to return more than one variable for the rewrite.
http://www.devserver.local/product.AB1234.htm?Affiliate=maverick
This one works except nothing gets returned in $2
RewriteCond %{QUERY_STRING} Affiliate=(.*)
RewriteRule ^product\.(.*).htm http://miva.devserver.local/Merchant2/merchant.mvc?Screen=PROD&Store_Code=EFY&Product_Code=$1&Affiliate=$2 [R,L]
This doesn't work
RewriteCond %{QUERY_STRING} Affiliate=(.*)
RewriteRule ^product\.(.*).htm(\?.*) http://miva.devserver.local/Merchant2/merchant.mvc?Screen=PROD&Store_Code=EFY&Product_Code=$1&Affiliate=$2 [R,L]
Can someone explain what I've done wrong.
Regards
Maverick
ASKER
Hello
Grab the affiliate code(Affiliate=Maverick) so it can be passed to the shopping cart
Cheers!
--John
Grab the affiliate code(Affiliate=Maverick) so it can be passed to the shopping cart
Cheers!
--John
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Hello Mercantilum,
The both rules were supposed to do the same thing, i was just documenting the things I tried.
The rule you provided worked flawlessly.
Thanks again,
Maverick
The both rules were supposed to do the same thing, i was just documenting the things I tried.
The rule you provided worked flawlessly.
Thanks again,
Maverick
RewriteCond %{QUERY_STRING} Affiliate=(.*)
RewriteRule ^product\.(.*)\.htm http://miva.devserver.local/Merchant2/merchant.mvc?Screen=PROD&Store_Code=EFY&Product_Code=$1&Affiliate=%1 [R,L]
What are you trying to do with the 2nd rule and \? ?
RewriteCond %{QUERY_STRING} Affiliate=(.*)
RewriteRule ^product\.(.*).htm(\?.*) http://miva.devserver.local/Merchant2/merchant.mvc?Screen=PROD&Store_Code=EFY&Product_Code=$1&Affiliate=%1 [R,L]