Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

NAV 2018 CU3 incorrect rewrite rule in tenant mode

(0) ShareShare
ReportReport
Posted on by

Hi,

We are using NAV with tenant databases and I had an issue after the installation that the rewrite rule assigned in IIS for the web client site seems wrong. The rule automatically set to enabled if you have tenant mode enabled for the instance.

The name of the rule is 'Hostname (without port) to tenant' and it should rewrite the given URL this way:

https://test.domain.com/dynamicsnav --> https://test.domain.com/dynamicsnav/?tenant=test

Rewrite action looks like this: /{R:0}?tenant={C:1}

Condition looks like this: ^([^:]*)(:[0-9]+)?$ for the input {HTTP_HOST}

which means the rewrite rule will do it the wrong way (opening the URL ends up in IIS error 403 - forbidden):

https://test.domain.com/dynamicsnav/?tenant=test.domain.com

The condition and the action of the rule should be modified in order to get it work:

New condition can be: [A-Za-z0-9](?:[A-Za-z0-9\-]{0,61}[A-Za-z0-9])?

New action can be: /{R:0}?tenant={C:0}

The new condition is based on RFCs for subdomain requirements:

  • Each subdomain part must have a length no greater than 63.
  • Each subdomain part must begin and end with an alpha-numeric (i.e. letters [A-Za-z] or digits [0-9]).
  • Each subdomain part may contain hyphens (dashes), but may not begin or end with a hyphen.

I can confirm that doing the mentioned modifications to the rule solves this issue.

*This post is locked for comments

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans