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.com✅Exact
www.example.com✅www. stripped → example.com
example.com/about✅Path ignored; hostname = example.com
example.com/login?next=/✅Query ignored; hostname = example.com
hr.example.com❌Only www. is stripped; hr. is not
sub.example.com❌Subdomain not stripped
app.hr.example.com❌Multi-level subdomain, no match
notexample.com❌Different hostname
example.com.evil.com❌Normalized to example.com.evil.com

Config: www.example.com

HostnameMatches?Reason
example.com✅Config strips www. → example.com
www.example.com✅Both strip www.
hr.example.com❌hr.example.com !== example.com
www.hr.example.com❌Strips to hr.example.com !== example.com

Config: hr.example.com

HostnameMatches?Reason
hr.example.com✅Exact
www.hr.example.com✅www. stripped → hr.example.com
example.com❌Parent domain, not matched
other.example.com❌Sibling subdomain
app.hr.example.com❌Child 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.com✅Strips www. → === base
hr.example.com✅Ends with .example.com
app.hr.example.com✅Ends with .example.com
a.b.c.example.com✅Ends with .example.com
notexample.com❌Does not equal or end with .example.com
other.com❌Unrelated
example.com.evil.com❌Ends 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