summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjschneider <jschneider@3ed937ae-f919-0410-9a43-8e6f19e4ba6e>2009-10-12 15:53:03 (GMT)
committerjschneider <jschneider@3ed937ae-f919-0410-9a43-8e6f19e4ba6e>2009-10-12 15:53:03 (GMT)
commit555be63708e9dd6ba4a8e43572fe0eb7b9101472 (patch)
treefc69790b14026c5f3fec63913606c5a2701b5d7a
parentcae1c5d7867257cc94577c73c79e2c983c281eba (diff)
downloadlarpe-555be63708e9dd6ba4a8e43572fe0eb7b9101472.zip
larpe-555be63708e9dd6ba4a8e43572fe0eb7b9101472.tar.gz
larpe-555be63708e9dd6ba4a8e43572fe0eb7b9101472.tar.bz2
Use RedirectMatch instead of rewrite rules in apache configuration
* larpe/admin/apache.py: use RedirectMatch and fix a rules when the homepage is redirect to the login page git-svn-id: svn+ssh://labs.libre-entreprise.org/svnroot/larpe@488 3ed937ae-f919-0410-9a43-8e6f19e4ba6e
-rw-r--r--larpe/trunk/larpe/admin/apache.py10
1 files changed, 4 insertions, 6 deletions
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)