diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx index 24df171570..0c26486b8b 100644 --- a/site/theme/template/Layout/Header.jsx +++ b/site/theme/template/Layout/Header.jsx @@ -87,7 +87,7 @@ export default class Header extends React.Component { if (utils.isLocalStorageNameSupported()) { localStorage.setItem('locale', utils.isZhCN(pathname) ? 'en-US' : 'zh-CN'); } - location.href = location.href.replace( + location.href = location.origin + location.pathname.replace( location.pathname, utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname)), );