diff --git a/.changeset/upset-parents-sniff.md b/.changeset/upset-parents-sniff.md new file mode 100644 index 000000000000..25c2cd62edb7 --- /dev/null +++ b/.changeset/upset-parents-sniff.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +fix: allow hosting hash-based apps from non-index.html files diff --git a/packages/kit/src/runtime/client/utils.js b/packages/kit/src/runtime/client/utils.js index c233ef9ae52f..5c77c80d22f0 100644 --- a/packages/kit/src/runtime/client/utils.js +++ b/packages/kit/src/runtime/client/utils.js @@ -317,16 +317,7 @@ export function is_external_url(url, base, hash_routing) { } if (hash_routing) { - if (url.pathname === base + '/' || url.pathname === base + '/index.html') { - return false; - } - - // be lenient if serving from filesystem - if (url.protocol === 'file:' && url.pathname.replace(/\/[^/]+\.html?$/, '') === base) { - return false; - } - - return true; + return url.pathname !== location.pathname; } return false;