'How to Redirect a URL using Application Gateway with Query included and Path excluded
I am not able to successfully redirect a URL with query to another target external URL.
eg:- Request URL:- http://example123.com/xxx/yy?path=com Target URL:- http://example456.com/zzz/yy
Condition:- I need to include the query string from the Request URL but not the Path.
I have tried using the path-based routing rule on the App GateWay with below configuration
But after hitting save its going back to a state like this:
Can anyone please find us a solution ??
Solution 1:[1]
According to configuration-request-routing-rules (github.com) , Path based rule may not send path to query and only applies it to path of url.
When you create a rule, you choose between basic and path-based.
- Choose basic if you want to forward all requests on the associated listener (for example, blog.contoso.com/*) to a single back-end pool.
- Choose path-based if you want to route requests from specific URL paths to specific back-end pools. The path pattern is applied only to the path of the URL, not to its query parameters.
Also see external-site | Microsoft Docs
Please check if you can try the rewriting URL path instead of redirecting which refers to this tutorial for implementation.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | kavyasaraboju-MT |
