Azure portal
Step 1. In the Azure portal you need to create a webapp. You do this by going to "Create a resource" and then choose a web app.
Step 2. In the newly created webapp go to Advanced tools (Kudu)
Step 3. In Kudu go to Debug console > cmd
Step 4. Browse to /site/wwwroot and click on the add ("+") button and choose to create a new file and name it web.config
Step 5. Click on the edit button for the web.config file and add in the following and hit save.
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect test enviornment" stopProcessing="true">
<match url="^test" />
<action type="Redirect" url="https://testurl.cloudax.dynamics.com" redirectType="Permanent" />
</rule>
<rule name="Redirect stage enviornment" stopProcessing="true">
<match url="^stage" />
<action type="Redirect" url="https://stageurl.cloudax.dynamics.com" redirectType="Permanent" />
</rule>
<rule name="Redirect dm enviornment" stopProcessing="true">
<match url="^dm" />
<action type="Redirect" url="https://datamigrationurl.cloudax.dynamics.com" redirectType="Permanent" />
</rule>
<rule name="Redirect qa enviornment" stopProcessing="true">
<match url="^qa" />
<action type="Redirect" url="https://qaurl.operations.dynamics.com/" redirectType="Permanent" />
</rule>
<rule name="Redirect header" stopProcessing="true">
<match url=".*" />
<action type="Redirect" url="https://www.google.com" redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Step 6. After hitting save you should now be able to access your azure web app in the following manner
https://yourwebappurl.com/test
https://yourwebappurl.com/qa
https://yourwebappurl.com/stage
https://yourwebappurl.com/dm
and they should now forward to their respective website.
If you do not include a /* tag and just put https://yourwebappurl.com then it should forward you to google.com as well
No comments:
Post a Comment