Skip to content

Commit 2dc12e6

Browse files
authored
Merge pull request #96 from AugustoL/fix-subdomian-netlify
fix: skip subdomain redirect for Netlify and GitHub Pages URLs
2 parents 771d366 + ecb02cf commit 2dc12e6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

‎src/utils/subdomainUtils.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ import { getSubdomainConfig, getSubdomainForNetwork } from "../config/subdomains
77
export function getSubdomain(): string | null {
88
const hostname = window.location.hostname;
99

10+
// Skip subdomain processing for Netlify preview/deploy URLs
11+
// These follow patterns like: pr-95--openscan.netlify.app, deploy-preview-123--site.netlify.app
12+
if (hostname.endsWith(".netlify.app")) {
13+
return null;
14+
}
15+
16+
// Skip subdomain processing for GitHub Pages
17+
if (hostname.endsWith(".github.io")) {
18+
return null;
19+
}
20+
1021
// Handle localhost subdomains (e.g., ethereum.localhost)
1122
if (hostname.endsWith(".localhost")) {
1223
return hostname.replace(".localhost", "");

0 commit comments

Comments
 (0)