Changes between Initial Version and Version 2 of Ticket #25878
- Timestamp:
- Dec 7, 2015, 7:45:41 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #25878
- Property Type Uncategorized → Bug
-
Ticket #25878 – Description
initial v2 21 21 host = request.get_host() 22 22 23 redirect = False 23 24 if settings.PREPEND_WWW and host and not host.startswith('www.'): 24 25 host = 'www.' + host 26 redirect = True 25 27 26 28 # Check if we also need to append a slash so we can do it all … … 28 30 if self.should_redirect_with_slash(request): 29 31 path = self.get_full_path_with_slash(request) 32 redirect = True 33 else: 34 path = request.get_full_path() 35 36 if (redirect): 30 37 return self.response_redirect_class('%s://%s%s' % (request.scheme, host, path)) 31 38 }}} … … 36 43 37 44 thanks for reading 45 46 PS changed a little - previous code won't work with prepending WWW