Unable to set a rewrite rule to redirect a path

MoTaar 80 Reputation points

Hi, I am trying to block the link https://abc.com/azerty/qwerty/cde/123

I want it to get redirected to https://abc.com/

Basically I want to catch "qwerty" whenever it's in the link and redirect it to host.

Here is how I set up my Rewrite rule:


1- in the Type of variable to check list, select Server variable.

2- In the Server variable list, select uri_path

3- Under Case-sensitive, select No.

4- In the Operator list, select equal (=).

5- pattern:



Rewrite type list, select URL.

Action type list, select Set.

Components, select Both URL path and URL query string

URL path value: /

Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
845 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,060 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 28,006 Reputation points Microsoft Employee


    I tried to repo your environment and the redirection works as expected for me.

    Direct access backend:

    User's image

    App gateway access:

    User's image

    Also, the Access Logs:

    User's image

    • This indicates the Rewrites are happening successfully.
    • Please check your configuration once again.

    Please note that the browser URL will not change.

    The external users will be oblivious to the URL Path rewrites done by App gateway and will continue to see the URL Path they provided in the request.



    0 comments No comments