Shibboleth vs mod_rewrite

Kaspar Brand kaspar.brand at switch.ch
Fri Oct 21 07:11:16 BST 2011


On 21.10.2011 04:57, Aaron Roots wrote:
> Having the full config in the .htaccess file doesn't work:
> $ cat .htaccess
> AuthType shibboleth
> ShibRequestSetting requireSession 1
> Require valid-user
> RewriteEngine On
> RewriteRule ^.*$ index.php
> 
> 
> Having it in a <Directory> block in apache.conf section doesn't work
> 
> Changing to using a <Location> block worked entirely - I'm still not sure
> totally sure why Location is the only one that works - as the rewrite's
> destination path is a real one - and presumed Apache would be applying
> .htaccess or Directory level config on real paths - whereas Location can
> be used for both real and virtuals. But I am sure there is a good reason
> that I have missed reading about somewhere.

Something feels odd with that configuration. To quote
http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule:

> Although rewrite rules are syntactically permitted in <Location> and 
> <Files> sections, this should never be necessary and is unsupported.

Is the FollowSymLinks option turned on for the directory in question?

Also, make sure that you're not introducing loops with your RewriteRule
directive - see
http://httpd.apache.org/docs/2.2/rewrite/flags.html#flag_l (the rule
shown above will very likely have this problem).

Kaspar


More information about the users mailing list