Having a small issue and hoped to get a few suggestions on how to proceed.
I have a site that goes through a payment form using post and sends back a long url with a query I just want to get rid off. The form uses hidden fields and I am not sure why it sends back a query string... but trying to work with it.
This is a typical url that gets sent back is:
I would like the url to be turned into the following, with the rest of the url cut off. The order_number is dynamic so that changes at times.
So when the url is sent to our server I would like .htaccess to cut off everything after view=orders
. Is this possible? I have tried:
RewriteCond %{QUERY_STRING} "view=orders" [NC]
RewriteRule (.*) /$1? [R=301,L]
No luck so far. Hope to get pointed in the right direction. Thanks so much!
Try with:
RewriteCond %{QUERY_STRING} ^(.*view=orders) [NC]
RewriteRule (.*) /$1?%1 [R=301,L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.