Skip to content
Snippets Groups Projects
Commit c09b8959 authored by Romain Derie's avatar Romain Derie
Browse files

[FIX] website: keep query strings when redirecting 'website.' page

Urls like `/page/website.XXX` are redirected to `/page/XXX`.

Before this commit, the redirection would not keep query strings:
`/page/website.XXX?rde=1` would redirect to `/page/XXX`.

Now, we keep the query strings:
`/page/website.XXX?rde=1` will redirect to `/page/XXX?rde=1`

Closes #24140

Courtesy of @MTantin
parent 78058259
No related branches found
No related tags found
No related merge requests found
......@@ -76,7 +76,10 @@ class Website(openerp.addons.web.controllers.main.Home):
}
# /page/website.XXX --> /page/XXX
if page.startswith('website.'):
return request.redirect('/page/' + page[8:], code=301)
url = '/page/' + page[8:]
if request.httprequest.query_string:
url += '?' + request.httprequest.query_string
return request.redirect(url, code=301)
elif '.' not in page:
page = 'website.%s' % page
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment