Azure Web App URL Rewrite not working

By : PNC
Source: Stackoverflow.com
Question!

I'm trying to get a basic URL rewrite to work for my Azure web App

<system.webServer>
    <rewrite>
        <rules>
            <rule name="SalesCloudGmail" stopProcessing="true">
                <match url="/SalesCloudGmail.aspx" />
                <action type="Redirect" url="/SalesCloudGmail" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

Was expecting to open the URL .../SalesCloudGmail.aspx and see .../SalesCloudGmail in the Address bar???

What Am I missing

By : PNC


Answers

Give this a try, your regex pattern matching is a little off based on how you're using it. But this should work or at least get you much closer.

<rule name="SalesCloudGmail" stopProcessing="true">
    <match url="(.*)" />
         <conditions logicalGrouping="MatchAll" trackAllCaptures="false">
            <add input="{REQUEST_URI}" pattern="^\/SalesCloudGmail\.aspx.*" />
         </conditions>
       <action type="Redirect" url="https://{HTTP_HOST}/SalesCloudGmail" />
 </rule>
By : henry


Please try below rewrite rule:

<rewrite>
      <rules>
        <rule name="SalesCloudGmail" stopProcessing="true">
         <match url="^\/SalesCloudGmail\.aspx$" />
          <action type="Redirect" url="/SalesCloudGmail" />
        </rule>
      </rules>
    </rewrite>

Please following this article to test your match pattern.



There may be a chance of string value in the column RVU.MA. Try out with the below query to find out such descrepancies.

   SELECT *
   FROM RVU
   WHERE ISNUMERIC (RVU.MA)!=1


This video can help you solving your question :)
By: admin