summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/server.go b/server.go
index f5db168..dd73ebc 100644
--- a/server.go
+++ b/server.go
@@ -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, "/")