[FIX] redirect /page/website.xyz --> /page/xyz. Currently 302 but fme will convert to 301

This commit is contained in:
Fabien Pinckaers 2014-08-26 10:29:18 +02:00
parent a360bc3126
commit b0d99b0ff0
1 changed files with 4 additions and 2 deletions

View File

@ -56,8 +56,10 @@ class Website(openerp.addons.web.controllers.main.Home):
values = {
'path': page,
}
# allow shortcut for /page/<website_xml_id>
if '.' not in page:
# /page/website.XXX --> /page/XXX
if page.startswith('website.'):
return request.redirect('/page/'+page[8:])
elif '.' not in page:
page = 'website.%s' % page
try: