Share via


How to: Enable URL Rewrite Rules for the Microsoft Dynamics NAV Web Client

If you deploy the Microsoft Dynamics NAV Web client in a multitenant deployment architecture, URLs that must access a specific tenant must specify the tenant ID. However, the Microsoft Dynamics NAV Web client can be accessed from URLs that either specify a host name or a SharePoint host URL. If your deployment must support either of these cases, you must enable the corresponding URL rewrite rule in the web.config file for the Microsoft Dynamics NAV Web Server components.

To configure the Microsoft Dynamics NAV Web client to accept host names for tenants

  1. On the computer that is running the Microsoft Dynamics NAV Web Server components, open the web.config file that is located in the physical path of the web application for the Microsoft Dynamics NAV Web client.

    The path is %systemroot%\inetpub\wwwroot\[VirtualDirectoryName]\WebClient. For example, the folder for the default Microsoft Dynamics NAV Web client application is %systemroot%\inetpub\wwwroot\DynamicsNAV71\WebClient.

    Note

    You must open the web.config file as an administrator or have permission to modify the file.

  2. In the <system.webServer> element, find the <rule name="Hostname (without port) to tenant" enabled="false" stopProcessing="true"> element, and then change the value of the enabled attribute to true.

  3. Save and close the web.config file.

This enables support for host names for the Microsoft Dynamics NAV Web Server components. If a tenant has been mounted with a host name as an alternative ID, the Microsoft Dynamics NAV Web client will accept a URL that contains this host name to identify the tenant.

If you create a non-tenant specific app for SharePoint that accesses the Microsoft Dynamics NAV Web client by using Windows Azure Active Directory, the resulting URL includes a parameter that specified a SharePoint host URL. This represents the URL for opening the Microsoft Dynamics NAV Web client that you have specified in the app manifest. You must enable a URL rewrite rule in order to accept the URL.

To configure the Microsoft Dynamics NAV Web client to accept SharePoint host URLs

  1. On the computer that is running the Microsoft Dynamics NAV Web Server components, open the web.config file that is located in the physical path of the web application for the Microsoft Dynamics NAV Web client.

    The path is %systemroot%\inetpub\wwwroot\[VirtualDirectoryName]\WebClient. For example, the folder for the default Microsoft Dynamics NAV Web client application is %systemroot%\inetpub\wwwroot\DynamicsNAV71\WebClient.

    Note

    You must open the web.config file as an administrator or have permission to modify the file.

  2. In the <system.webServer> element, find the <rule name="SPHostUrl to tenant" enabled="false" stopProcessing="true"> element, and then change the value of the enabled attribute to true.

  3. Save and close the web.config file.

This enables support for SharePoint host URLs for the Microsoft Dynamics NAV Web Server components. An app for SharePoint can generate a URL for the Microsoft Dynamics NAV Web client that includes an SPHOSTURL parameter that identifies the tenant-specific site SharePoint site. The Microsoft Dynamics NAV Web client will use the SPHOSTURL parameter to identify the Microsoft Dynamics NAV tenant.

Warning

You must also add all SharePoint host URLs that can access a tenant to that tenants list of alternative IDs. For more information, see How to: Mount or Dismount a Tenant on a Microsoft Dynamics Server Instance.

See Also

Tasks

How to: Mount or Dismount a Tenant on a Microsoft Dynamics Server Instance

Concepts

Multitenant Deployment Architecture
Configuring the Microsoft Dynamics NAV Web Server and Client
Microsoft Dynamics NAV as an App for SharePoint