Sling mapping multi language site
Hi,
I've tried searching the forum, but did not find an answer to my question.
We have a multi language site, with two languages English and Spanish.
Our site structure is as follows:
content
|----mysite
|-------es
|----... (spanish pages)
|-------en
|----... (english pages pages)
The default urls are something like this:
www.myhost.com/content/mysite/en/welcome.html
By using sling mappings I would like to become the following:
www.myhost.com/en/welcome.html
So get rid of the /content/mysite/ part en keep the locale.
Using the following sling mapping, I am able to get rid of the /content/mysite/en part
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:Mapping"
sling:internalRedirect="[/content/mysite/en/(.*)]"
sling:match="www.myhost.com/$1"/>
The link checker (transformer) rewrites the menu links to:
www.myhost.com/welcome.html and these links work.
But when I want to keep the locale, with the following mapping:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:Mapping"
sling:internalRedirect="[/content/mysite/(.*)]"
sling:match="www.myhost.com/$1"/>
I get links like this: www.myhost.com/en/welcome.html, but these result in a 404.
The log shows the following message:
GET /content/mysite/en/en/welcome.html HTTP/1.1] org.apache.sling.engine.impl.SlingRequestProcessorImpl service: Resource /content/mysite/en/en/welcome.html not found
Somehow the locale is duplicated now.
Can someone explain me what I'm doing wrong ?
Thanks for your help!
