I've followed this guide for creating SEO-conform Multilanguage urls, now I need to fit url rules for a few modules using slug urls.
Used rule is working fine for reading urls, i.e. writing the url like
www.mywebsite.com/en/pages/hello-world
(it loads the right page).
But using createUrl function it returns a valid url only if slug does not contains any dash, i.e. with slug "hello" createUrl returns
www.mywebsite.com/en/pages/hello
but with slug "hello-world" createUrl returns
www.mywebsite.com/pages/hello-world/language/en
This is the used rule:
'<language:(en|de)>/<controller:pages>/<slug:[\w\-]+>'=>'pages/view'
And I'm calling createUrl in this way:
createUrl('pages/' . $slug)
I can't figure out what's wrong...