[svlug] [FULLY SOLVED] mod rewrite debugging

Ivan Sergio Borgonovo mail at webthatworks.it
Sat Sep 6 05:31:40 PDT 2014


I already had clear that 2 global rewrite conf weren't ideal (there is
no rule to decide the order) but still I wasn't able to make at least
one work.

So... well after messing around a bit I'll skip all the trial I've made
but the solution was to merge the rewrite rule in one global file
(that's a pity since it would be nice to be able to use
a2enconf/a2disconf) I got it working without changing the local .htacess

/etc/apache2/conf-enabled/horde-rewrite.conf

<Directory /usr/share/horde>
  <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteOptions InheritDown

    #Activesync
    RewriteEngine On
    RewriteOptions InheritDownBefore
    RewriteRule .* -
[E=HTTP_MS_ASPROTOCOLVERSION:%{HTTP:Ms-Asprotocolversion}]
    RewriteRule .* - [E=HTTP_X_MS_POLICYKEY:%{HTTP:X-Ms-Policykey}]
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # HTTPS
    RewriteCond %{HTTPS} !on
    RewriteCond %{REMOTE_ADDR} !^(192\.168\..*|10\..*)
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

  </IfModule>
</Directory>

-- 
Ivan Sergio Borgonovo
http://www.webthatworks.it





More information about the svlug mailing list