Keeping the Original URL While Redirecting in Azure Application Gateway

krutibasa majhi 25 Reputation points
2025-01-30T12:10:49.1766667+00:00

Hello everyone,

Can Azure Application Gateway send traffic to another URL while keeping the original URL in the browser?

I have https://user.mysite.co this is pointed at the public ip of the application gateway WAF_v2. When user hits this, I want them to be taken to https://test.mysite.co/.

However, at the same time, I want the user to see user.mysite.co in the browser. They shouldn't see test.mysite.co.

Is it possible through Application gateway can anyone guide me please.

Thanks

Krutibasa

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,122 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Udayashankar K.N 160 Reputation points Microsoft Employee
    2025-01-30T12:35:27.9866667+00:00

    Hi

    Redirect mechanism can be an option to the above however need to check the dependecies .

    Please refer to the below

    https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url#understanding-rewrites-in-application-gateway

    Rewrite Condition: This is an optional configuration. Based on the conditions that you define, the Application Gateway will evaluate the contents of the HTTP(S) requests and responses. The subsequent "rewrite action" will occur if the HTTP(S) request or response matches this condition. If you associate more than one condition with an action, the action occurs only when all the conditions are met. In other words, it is a logical AND operation. You can use rewrite conditions to evaluate the content of HTTP(S) requests and responses. This optional configuration enables you to perform a rewrite only when one or more conditions are met. The application gateway uses these types of variables to evaluate the content of requests and responses:

    You can choose the following types to look for a condition:


  2. Achraf Ben Alaya 1,141 Reputation points MVP
    2025-01-30T12:37:01.78+00:00

    hi @krutibasa majhi actually you can achieve this using the Rewrite rule in order to change the host header from user...co to test....co .you need to make sure that your backend accepts requests with rewritteen hostnames :

    check this url : https://learn.microsoft.com/en-us/azure/application-gateway/rewrite-http-headers-url?wt.mc_id=MVP_328341

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.