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