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
| Hostname | Matches? | 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
| Hostname | Matches? | 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.
| Hostname | Matches? | 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.
| Hostname | Rule used |
|---|
example.com | Exact example.com wins |
www.example.com | Exact example.com wins |
hr.example.com | No exact match → wildcard used |
app.hr.example.com | No exact match → wildcard used |
Things That NEVER Affect Matching
| Component | Example | Effect |
|---|
| Path | /about, /login | Ignored |
| Query string | ?id=123&next=/home | Ignored |
| Hash | #section-2 | Ignored |
| Port | :8080, :443 | Ignored |
| Protocol | https://, http:// | Ignored |
Feedback
Was this page helpful?
Last modified
: May 28, 2026