Introduction

This guide will help you perform a URL rewrite in IIS to remove the org name from the URL for Microsoft Dynamics CRM On-Premise. We provide a step-by-step instructions and possible scenario where this can be helpful.

Setting the stage

One of Celedon Partners’ clients is using CRM 2011 On-Premise with Development (dev), Training (train), and Production (prod) environments. Whereas the Train and Prod instances are using IFD (internet-facing deployment), the Dev instance is only deployed internally. Withing the client’s CRM front-end application in IIS, they have deployed a custom ASP.NET web application as a sub-site. Therefore, the url to the custom website looks something like this:
https://MyCRm.MyDomain.com/CustomApp/default.aspx

The above format works nicely for Train and Prod instances (which use IFD), however, fails in Dev environment. For non-IFD organizations, like Dev, the org name appends to the URL, thus causing the custom web app to fail. The URL to custom site in Dev looks something like this:
https://MyCRm.MyDomain.com/MyOrg/CustomApp/default.aspx

As a result, the app fails to load.

Solution (Step-By-Step Guide)

To overcome this issue, I decided to eliminate the org name from the URL anytime a call is made to the custom application. The following steps describe how to create a custom URL Rewrite Rule in IIS to remove the org name from URL when accessing a custom site hosted under CRM.

  1. Navigate to the server where the CRM On-Prem is hosted.
  2. Open IIS and navigate to the Microsoft Dynamics CRM site.
  3. Open the URL Rewrite Section
  4. On the Actions Panel, located at the right edge of the screen, click Add Rules
  5. On the Add Rules dialog, press select Blank rule and hit OK button
  6. Configure the Rule as shown in the picture below and hit Apply

Now all the requests to the custom web app should go to URL without the org name in it!