diff --git a/book/_addons/language_redirect.html b/book/_addons/language_redirect.html index 9e8bfbc..0db37ab 100644 --- a/book/_addons/language_redirect.html +++ b/book/_addons/language_redirect.html @@ -7,7 +7,10 @@ var userLang = navigator.language || navigator.userLanguage; var langPrefix = userLang.split("-")[0]; var supportedLangs = ["en", "ko"]; - var siteURL = window.location.href.split('/index.html')[0] + '/'; + var siteURL = window.location.href.split('/index.html')[0]; + if (!siteURL.endsWith('/')) { + siteURL += '/'; + } var targetLang = supportedLangs.includes(langPrefix) ? langPrefix : "en"; window.location.replace(siteURL + targetLang + "/index.html"); @@ -16,3 +19,6 @@
Redirecting to the appropriate language...