Shibboleth vs mod_rewrite

Aaron Roots aaron.roots at deakin.edu.au
Fri Oct 21 03:57:35 BST 2011


Awesome - this got me on the right track. I didn't realise there would be
a hugely functional difference between using the same directives in the
three different types of sections. I really thought they were just
different ways of achieving the exact same thing:

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.

Cheers heaps for your help
Aaron


On 19/10/11 4:52 PM, "Brent Putman" <putmanb at georgetown.edu> wrote:

>
>
>On 10/19/11 1:02 AM, Aaron Roots wrote:
>> Cheers for the articles and information
>>
>> However unlike the drupal example - the shibboleth protection is on the
>> same directory as the real and rewritten path.
>>
>> For example this is basically my setup:
>>    http://server/folder/ is the location being protected (ie <Location
>> /folder> etc)
>>    http://server/folder/index.php would be the real path
>>    http://server/folder/rewrite would be the rewrittable path that
>> rewrites to http://server/folder/index.php
>
>
>Ok, I see. Well that should be even simpler then. I can't see why that
>wouldn't work.
>
>
>> Going directly to http://server/folder/index.php works as expected -
>>going
>> to the http://server/folder/rewrite path - we don¹t get the expected Env
>> vars - just the REDIRECT_ ones
>>
>
>
>I just tried your set up and it works for me. Since you mentioned you
>were using a .htaccess file for the RewriteRule, I even replicated that
>(instead of putting the rewrite in the Apache .conf), as best I
>understood what you were doing.
>
>Here's what I have:
>
>Apache .conf:
>
><Location /phpshibtest>
>AuthType shibboleth
>ShibRequestSetting requireSession 1
>require shibboleth
></Location>
>
>
>/phpshibtest/.htaccess :
>
>RewriteEngine On
>RewriteRule ^.*$ index.php
>
>
>
>So basically everything is rewritten to invoke /phpshibtest/index.php
>(which is just "<?php phpinfo(); ?>")
>
>With that config, for anything under /phpshibtest (e.g. /shibtest/foo) I
>get for example both an "eppn" and a "REDIRECT_eppn".
>
>Are you doing something substantially different than the above?
>
>--Brent
>
>--
>To unsubscribe from this list send an email to
>users-unsubscribe at shibboleth.net



More information about the users mailing list