Our customer has specified the domains that he wants for every language as:
www.domain.com -> Spanish www.domain.com/en -> English
For this, we configured cd_dynamic_conf.xml
as:
<Configuration Version="7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="schemas/cd_dynamic_conf.xsd">
<URLMappings>
<StaticMappings>
<Publications>
<Publication Id="28">
<Host Protocol="http" Domain="www.domain.com" Port="" Path="" />
</Publication>
<Publication Id="29">
<Host Protocol="http" Domain="www.domain.com" Port="" Path="en" />
</Publication>
</Publications>
</StaticMappings>
<StorageMapping IdentifyPublicationByProperty="publicationUrl"/>
</URLMappings>
<TCDLEngine>
<Properties>
</Properties>
</TCDLEngine>
</Configuration>
For the first domain we defined and empty Path. But It seems that is not supported.
If we visit an url as:
www.domain.com/social
The Resolver is determining the publicationId
correctly and is working fine.
But if we visit an url as:
www.domain.com/beneficios
The Resolver is determining as publicationId the publication of English. It seems that is matching en in the url and is assigning an incorrect publication.
Then, we deduced that the first case is working because it's not matching anything and it's getting it by default.
Is the empty path supported?
The other option that we managed is to include a path that we rewrite using apache (like "es" or something similar), but this option has two problems:
- We have to add some Rewrite rules in apache that make all more complicated.
- All the url's includes these artificial path and we have to manage as exception, including the componentLink resolver. All the url's that DXA or Tridion resolve are incorrect for our website.
Also, We tried a configuration as:
<Configuration Version="7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="schemas/cd_dynamic_conf.xsd">
<URLMappings>
<StaticMappings>
<Publications>
<Publication Id="28">
<Host Protocol="http" Domain="www.domain.com" Port="" Path="" />
</Publication>
<Publication Id="29">
<Host Protocol="http" Domain="www.domain.com" Port="" Path="/en/" />
</Publication>
</Publications>
</StaticMappings>
<StorageMapping IdentifyPublicationByProperty="publicationUrl"/>
</URLMappings>
<TCDLEngine>
<Properties>
</Properties>
</TCDLEngine>
</Configuration>
We added two /
in the path of the English site to avoid the path matching, but this doesn't work. It seems that is removing the /
from the path to match with the url.
Also, the problem is that the process that is resolving the publicationId
in the cd_dynamic.jar
and we cannot modify it.
Any solution? Thank you!