Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/upset-parents-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@sveltejs/kit': minor
---

feat: allow hosting hash-based apps from non-index.html files
11 changes: 5 additions & 6 deletions packages/kit/src/runtime/client/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,12 +317,11 @@ 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) {
if (
url.pathname === base + '/' ||
url.pathname === base + '/index.html' ||
url.pathname.replace(/\/[^/]+\.html?$/, '') === base
) {
return false;
}

Expand Down