From f2583323a9d15e27e254c0228d04360bf8697bf1 Mon Sep 17 00:00:00 2001 From: Fabien Meghazi Date: Wed, 27 Aug 2014 14:05:09 +0200 Subject: [PATCH] [FIX] language and model converter redirections should use code=301 --- addons/website/models/ir_http.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/website/models/ir_http.py b/addons/website/models/ir_http.py index bda12758dd8..db41719a08b 100644 --- a/addons/website/models/ir_http.py +++ b/addons/website/models/ir_http.py @@ -114,7 +114,7 @@ class ir_http(orm.AbstractModel): if request.lang == request.website.default_lang_code: # If language is in the url and it is the default language, redirect # to url without language so google doesn't see duplicate content - return request.redirect(path + '?' + request.httprequest.query_string) + return request.redirect(path + '?' + request.httprequest.query_string, code=301) return self.reroute(path) return super(ir_http, self)._dispatch() @@ -155,7 +155,7 @@ class ir_http(orm.AbstractModel): path = '/' + request.lang + path if request.httprequest.query_string: path += '?' + request.httprequest.query_string - return werkzeug.utils.redirect(path) + return werkzeug.utils.redirect(path, code=301) def _serve_attachment(self): domain = [('type', '=', 'binary'), ('url', '=', request.httprequest.path)]