Forum Moderators: phranque

Message Too Old, No Replies

Rewrite query string correctly

Rewrite query string correctly. Replace incorrect? With &

         

stephensaid

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

5+ Year Member



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.

lucy24

10:09 pm on Jul 12, 2018 (gmt 0)

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



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.

stephensaid

4:48 am on Jul 13, 2018 (gmt 0)

5+ Year Member



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.