From 324919bcf0090963fdb320a91face8ab0e906930 Mon Sep 17 00:00:00 2001 From: "Florimond Husquinet (fhu)" Date: Wed, 28 Aug 2019 07:40:47 +0000 Subject: [PATCH] [FIX] website_blog:redirection 301 instead of 302 to new blog -Create a second blog -Move one post to this second blog -Access the post with the url from the first blog Before this commit: You will get redirected to the new url with a code 302 (temporary). After this commit: You will get redirected to the new url with the code to 301 (permanent). OPW-2059194 closes odoo/odoo#36161 Signed-off-by: Nicolas Martinelli (nim) --- addons/website_blog/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/website_blog/controllers/main.py b/addons/website_blog/controllers/main.py index 1d09540e8cf..51a2deb3158 100644 --- a/addons/website_blog/controllers/main.py +++ b/addons/website_blog/controllers/main.py @@ -230,7 +230,7 @@ class WebsiteBlog(http.Controller): blog_url = QueryURL('', ['blog', 'tag'], blog=blog_post.blog_id, tag=tag, date_begin=date_begin, date_end=date_end) if not blog_post.blog_id.id == blog.id: - return request.redirect("/blog/%s/post/%s" % (slug(blog_post.blog_id), slug(blog_post))) + return request.redirect("/blog/%s/post/%s" % (slug(blog_post.blog_id), slug(blog_post)), code=301) tags = request.env['blog.tag'].search([])