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.
That should work to some degree. If a request came in for Website Hosting - Mysite.com it would get redirected to (notice the double slash ‘//’ as you had /store/s/[HTTP::uri when you are probably wanting /store/s[HTTP::uri]
If the URI does not start with /? it will redirect back to the same location they requested, which will cause a permanent redirect loop. You should remove the else portion of the iRule.
That didn’t quite work as it never matched the ?. However, I tried a slight modification and it does work. Instead of using HTTP::path, I’m using HTTP::uri and it does match and redirect as I need. In case anyone else is following, here is the rule that I’m currently using: