Skip to content

Welcome

Matched /{lang:nonfile?}/welcome - a constrained optional in the middle of a template.

lang
de

How the pieces combine

Two features stack here. The optional marker parses anywhere (framework parity, effectively required in the middle), and the nonfile validation constraint rejects any first segment that looks like a file name - a segment whose last part contains a . followed by something. So /en/welcome matches while /style.css/welcome falls through to the 404 fallback.

@* /en/welcome        → lang = "en"
   /style.css/welcome → no match ("style.css" is a file name)
   /welcome           → no match (middle optional is required at match time) *@
<Broute Path="/{lang:nonfile?}/welcome" Component="@typeof(WelcomePage)" />