With the example URL:
www.domain.com/contact-us
Which renders in English. There are a set of other languages this website supports:
www.domain.com/es/contact-us
www.domain.com/jp/contact-us
www.domain.com/de/contact-us
www.domain.com/pt/contact-us
Here is the re-write rule for English (default language)
<rewrite url="^/contact-us(\?(.+))?$" to="~/Pages/Contact.aspx$1" processing="stop"/>
How would I modify this/add a new rule to re-write:
www.domain.com/jp/contact-us
To:
~/Pages/Contact.aspx?language=jp
Preferably without having to write a new rule, for every language for every content page!
To complicate things, it needs to match IETF language tags. These are varied enough that it looks like a regex to match them would be a difficult route: https://en.wikipedia.org/wiki/IETF_language_tag
Ideally I need to get the list of languages from the database, and match the language tag field on the fly. But I'm not sure how to do this as I've only ever written static rules.
/de/contact-usit gives/contact-us?lang=debutRewritePathneeds a physical path which means it looks like I should write all my url rewrite rules in this module?