diff options
author | Peter Palfrader <peter@palfrader.org> | 2006-10-23 14:52:12 +0000 |
---|---|---|
committer | weasel <weasel@bc3d92e2-beff-0310-a7cd-cc87d7ac0ede> | 2006-10-23 14:52:12 +0000 |
commit | e2250fb567afacc6db194354eaefccbd12bd0d22 (patch) | |
tree | 08c598203689556012515b0a16f66ad529c27fdf | |
parent | 037c11386701f5468522d12da313c123dafc1ae5 (diff) |
Support canonical
git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@232 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede
-rwxr-xr-x | bin/ldap2apache | 6 |
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" |