Welcome to WebmasterWorld Guest from 54.225.32.164

Forum Moderators: Ocean10000 & phranque

Rewrite query string correctly

Rewrite query string correctly. Replace incorrect? With &

     
9:30 pm on Jul 12, 2018 (gmt 0)

New User

joined:July 12, 2018
posts: 2
votes: 0


My payment gateway redirects successful orders to the following url:

https://example.com/checkout/order-received/33510/?key=wc_order_5b47427fe053c?params=...


I need to rewrite this to:

https://example.com/checkout/order-received/33510/?key=wc_order_5b47427fe053c&params=...


The URL I am sending to the payment gateway already has a Query String and the gateway is appending another string to it using a ? instead of an &.

How can I change the second ? into an &?

Can someone help, please?

Thanks.
10:09 pm on July 12, 2018 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month

joined:Apr 9, 2011
posts:14898
votes: 648


I need to rewrite this to:
Rewrite (internal changes behind the scenes) or redirect (ask visitor to make a fresh request)?

What have you tried so far? Since this is the apache subforum, I will assume you’re doing it in mod_rewrite, using a RewriteCond to evaluate the query string.
4:48 am on July 13, 2018 (gmt 0)

New User

joined:July 12, 2018
posts: 2
votes: 0


That is the way I was thinking to go but it is out of my league and do not know how to start.

And yes, I need to evaluate both parameters of the query string with PHP after I sort this out. But that's another issue which I think I have sorted.