Forum Moderators: phranque
request = context.REQUEST
if request.URL.find('manage.example.com') == -1: # skip all if management hostname
..if request.URL.find('example.com/shop') != -1: # skip rest if not browsing the shop
....if request.URL[0:5] != 'https':
......request.setServerURL('https', 'secure.example.com', '443')
......return request.RESPONSE.redirect(context.absolute_url(), status=301, lock=1)
..else: # not in shop
....if request.URL[0:5] != 'http:':
......request.setServerURL('http', 'www.example.com', '80')
......return request.RESPONSE.redirect(context.absolute_url(), status=301, lock=1)