Skip to content
Open
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
11 changes: 10 additions & 1 deletion packages/gatsby/cache-dir/loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,16 @@ export class ProdLoader extends BaseLoader {
}
// check if html file exist using HEAD request:
// if it does we should navigate to it instead of showing 404
return doFetch(rawPath, `HEAD`).then(req => {

// OLD CODE

// return doFetch(rawPath, `HEAD`).then(req => {

// NEW FIX: include pathPrefix
const prefixedPath = __PATH_PREFIX__
? __PATH_PREFIX__ + rawPath
: rawPath
return doFetch(prefixedPath, `HEAD`).then(req => {
if (req.status === 200) {
// page (.html file) actually exist (or we asked for 404 )
// returning page resources status as errored to trigger
Expand Down