From e2250fb567afacc6db194354eaefccbd12bd0d22 Mon Sep 17 00:00:00 2001 From: Peter Palfrader Date: Mon, 23 Oct 2006 14:52:12 +0000 Subject: Support canonical git-svn-id: svn+ssh://asteria.noreply.org/svn/weaselutils/trunk@232 bc3d92e2-beff-0310-a7cd-cc87d7ac0ede --- bin/ldap2apache | 6 ++++++ 1 file changed, 6 insertions(+) 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" -- cgit v1.2.3