diff --git a/site/theme/template/Layout/Header.jsx b/site/theme/template/Layout/Header.jsx index 1387f6646c..3bf5511774 100644 --- a/site/theme/template/Layout/Header.jsx +++ b/site/theme/template/Layout/Header.jsx @@ -42,7 +42,11 @@ export default class Header extends React.Component { handleLangChange = () => { const pathname = this.props.location.pathname; - location.href = location.href.replace(location.pathname, utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname))); + if (pathname === '/') { + location.pathname = utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname)); + } else { + location.href = location.href.replace(location.pathname, utils.getLocalizedPathname(pathname, !utils.isZhCN(pathname))); + } } render() {