Domain Matching Rules

Domain matching rules for custom mapping matching customization.

Exact Match Rules (config does NOT start with *)

Config: example.com

Hostname (from URL)Matches?Reason
example.comExact
www.example.comwww. stripped → example.com
example.com/aboutPath ignored; hostname = example.com
example.com/login?next=/Query ignored; hostname = example.com
hr.example.comOnly www. is stripped; hr. is not
sub.example.comSubdomain not stripped
app.hr.example.comMulti-level subdomain, no match
notexample.comDifferent hostname
example.com.evil.comNormalized to example.com.evil.com

Config: www.example.com

HostnameMatches?Reason
example.comConfig strips www.example.com
www.example.comBoth strip www.
hr.example.comhr.example.com !== example.com
www.hr.example.comStrips to hr.example.com !== example.com

Config: hr.example.com

HostnameMatches?Reason
hr.example.comExact
www.hr.example.comwww. stripped → hr.example.com
example.comParent domain, not matched
other.example.comSibling subdomain
app.hr.example.comChild subdomain; only www. is stripped

Wildcard Rules (config starts with *)

Both *example.com and *.example.com normalize to base example.com.

Config: *example.com or *.example.com

HostnameMatches?Reason
example.com=== base
www.example.comStrips www.=== base
hr.example.comEnds with .example.com
app.hr.example.comEnds with .example.com
a.b.c.example.comEnds with .example.com
notexample.comDoes not equal or end with .example.com
other.comUnrelated
example.com.evil.comEnds with .com, not .example.com

Exact vs. Wildcard Priority

When both example.com (exact) and *.example.com (wildcard) are in config, exact entries are evaluated first. Wildcard is only used as a fallback.

HostnameRule used
example.comExact example.com wins
www.example.comExact example.com wins
hr.example.comNo exact match → wildcard used
app.hr.example.comNo exact match → wildcard used

Things That NEVER Affect Matching

ComponentExampleEffect
Path/about, /loginIgnored
Query string?id=123&next=/homeIgnored
Hash#section-2Ignored
Port:8080, :443Ignored
Protocolhttps://, http://Ignored

Last modified : May 28, 2026