summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2006-10-23 14:52:12 +0000
committerweasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede>2006-10-23 14:52:12 +0000
commite2250fb567afacc6db194354eaefccbd12bd0d22 (patch)
tree08c598203689556012515b0a16f66ad529c27fdf
parent037c11386701f5468522d12da313c123dafc1ae5 (diff)
Support canonical
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@232 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-xbin/ldap2apache6
1 files changed, 6 insertions, 0 deletions
diff --git a/bin/ldap2apache b/bin/ldap2apache
index 312eb81..ef0b081 100755
--- a/bin/ldap2apache
+++ b/bin/ldap2apache
@@ -122,6 +122,12 @@ clients.each{ |c|
config << " ServerAlias #{server_aliases}" if server_aliases != ""
config << " ServerAdmin #{server_admin}"
config << ""
+ if property['canonical'] == "yes"
+ config << " RewriteEngine on"
+ config << " RewriteCond %{HTTP_HOST} !^#{server_name}$"
+ config << " RewriteRule ^/(.*) %s://#{server_name}/$1 [R]"%[ ( ssl ? 'https' : 'http' ) ]
+ end
+ config << ""
config << " UserDir disabled" unless property['userdir'] == "yes"
config << " SuexecUserGroup #{c['uid']} #{c['uid']}" unless property['setusergroup'] == "no"
#config << " User #{c['uid']}" unless property['setusergroup'] == "no"