15-Feb-2023 17:58
Need Help to write irule :
Redirects are for HTTP requests made with a path prefix matching https://xyz.test.com/age/signup.
Matching requests should be redirected to https://abc.test.com/#/inSign/invite,
Additionally, a new query parameter should be appended to the resulting URL: account=xyz
The redirected request should include the query parameters supplied from the original request before the redirect.
15-Feb-2023 21:42
@Aj2 This should do exactly what you would like for the hosts and uri paths provided.
when HTTP_REQUEST priority 500 {
set HOST [HTTP::host]
set URI [string tolower [HTTP::uri]]
if { ((${HOST} == "xyz.test.com") && (${URI} == "/age/signup")) } {
HTTP::redirect "https://abc.test.com/#/inSign/invite?account=xyz"
}
}
16-Feb-2023 13:02 - edited 16-Feb-2023 13:03
Awesome @Paulius ,
I will add an info for you , its highly recommended to give up using variables in your Scripts , and use it when you have to use it only.
that's for performance concerns.
17-Feb-2023 12:10
Not sure in this case, Mohamed...
I get a feeling the example is more general, and variables would be needed. When Aj2 wrote "zyz" I imagine it may take up any value.
@Aj2, can you confirm the need for string replacement in your request? Or did Paulius answer your needs 100%?
/Mike