diff options
-rw-r--r-- | server.go | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -44,7 +44,7 @@ func router(w http.ResponseWriter, r *http.Request) { Name: "redirect", Path: "/", }) - http.Redirect(w, r, lang + "/", http.StatusMovedPermanently) + http.Redirect(w, r, url + lang + "/", http.StatusMovedPermanently) return } @@ -52,7 +52,7 @@ func router(w http.ResponseWriter, r *http.Request) { parts := strings.Split(path, "/") _, err = r.Cookie("redirect") - if isSupportedLanguage(parts[0]) { + if isSupportedLanguage(parts[0]) && parts[0] != lang { if r.Header.Get("Referer") == "" && err != nil { parts[0] = lang path = strings.Join(parts, "/") |