Reply To: Problem with changing language while using language base in SEO urls

Splash Forums PrettyFaces Users Problem with changing language while using language base in SEO urls Reply To: Problem with changing language while using language base in SEO urls

#24344

Yeah, this happens because your mapping is matching the URL of JSF resources. The pattern for the details mapping is /#{lang}/#{category}/#{OSG}. And requests like /javax.faces.resources/something/somefile.js are matching this pattern and are therefore rewritten.

So common best practice to fix this issue is to restrict the regular expression for the path parameters. By default the pattern [^/]+ is used for path parameters which actually means “everything except /”. I guess restricting the pattern for the language parameter makes sense and should fix this issue. Something like this:


<url-mapping id="base">
  <pattern value="/#{ /[a-z]{2}/ lang }" />
</url-mapping>

See this page for details:

http://ocpsoft.org/docs/prettyfaces/3.3.3/en-US/html/Configuration.html#config.pathparams.regex