diff --git a/selectors/general.js b/selectors/general.js index 0a00a3f2db00..b01e8403d977 100644 --- a/selectors/general.js +++ b/selectors/general.js @@ -17,5 +17,9 @@ export function areTimezonesEnabledAndSupported(state) { export function getBasePath(state) { const config = getConfig(state) || {}; - return new URL(config.SiteURL || window.location.origin).pathname; + if (config.SiteURL) { + return new URL(config.SiteURL).pathname; + } + + return window.basename || window.location.origin; }