Joe_Greco_BBB_1
Jan 15, 2015Nimbostratus
Search URI for ?
I have a customer that wants to capture a user entering a "?" into the URI as a search string, and perform a redirect on it. I've tried several ways to capture this, but none seem to work properly.
The users would enter something like: http://mysite.com/?freeshipping I want to find the /? and do a redirect to http://mysite.com/store/s/freeshipping
I've included one of my attempts with the hope that someone has already figured this out?
Here's what I came up with:
when HTTP_REQUEST { if { [HTTP::uri] starts_with "/?" } { HTTP::redirect "http://[HTTP::host]/store/s/[HTTP::uri]" } else { HTTP::redirect "http://[HTTP::host][HTTP::uri]" } }
Any help would be greatly appreciated!