diff --git a/larpe/trunk/larpe/admin/apache.py b/larpe/trunk/larpe/admin/apache.py index 3fd607f..cb01760 100644 --- a/larpe/trunk/larpe/admin/apache.py +++ b/larpe/trunk/larpe/admin/apache.py @@ -276,20 +276,18 @@ class Location(object): conf_lines.append(self.python_path) if self.output_filters: conf_lines.append(self.output_filters) - # Enable rewrite module - if self.old_auth_url is not None or self.old_logout_url is not None: - conf_lines.append('RewriteEngine On') + # Redirect rules # Redirect old authentication url to the new one if self.old_auth_url is not None and self.host.auth_form_places == 'form_once': conf_lines.append( - 'RewriteRule %(old_auth_url)s %(new_auth_url)s [R]' % self.cfg) + 'RedirectMatch %(old_auth_url)s %(new_auth_url)s' % self.cfg) # Redirect old logout url to the new one if self.old_logout_url is not None: conf_lines.append( - 'RewriteRule %(old_logout_url)s %(new_logout_url)s [R]' % self.cfg) + 'RedirectMatch %(old_logout_url)s %(new_logout_url)s' % self.cfg) # Redirect the home page to the login page if self.host.redirect_root_to_login is True: - conf_lines.append('RewriteRule /$ %(new_auth_url)s [R]' % self.cfg) + conf_lines.append('RedirectMatch ^/$ %(new_auth_url)s' % self.cfg) # Convert urls in http headers to/from the new domain conf_lines.append('ProxyPass %(orig_url)s' % self.cfg) conf_lines.append('ProxyPassReverse %(orig_url)s' % self.cfg)