I want to write an irule so that it will redirect/respond this to below and it will preserve all dynamic variables(XXX) during redirect or respong. .xyz Domain Names | Join Generation XYZ
I have tried to write irule, but its not working :
when HTTP_REQUEST { if {[string tolower [HTTP::uri]] starts_with “/test_check”} { HTTP::respond 302 Location “https://xyz.com/testing/[URI::query [HTTP::uri]]” } }
Please provide suggestions/help me to resolve this.
Hi, result of [URI::query [HTTP::uri]] in your case is just test_id=XXX. But you want to preserve all parts of the path. Is it correct? Try this: … https://xyz.com/testing[HTTP::uri] …
So glad you got this working (now ages ago!) I was wondering, if you still check in here, could I implement this same solution with a longer path & switching the hostname, such as: