[SWLUG] httpd-perl.conf rewrite question

bascule asura at theexcession.co.uk
Fri Mar 18 23:40:42 UTC 2005


following geraint's help with my server logs i've revisited my attempts to 
rewrite requests to port80 to port 443, i remember that i had no luck in 
getting this to work for individual </Directory> sections, so i resorted to a 
global entry that excluded the one part of my server that didn't work with 
https - the perl stuff that handles my mp3s, of course as it turns out it 
never occurred to me that this would redirect all the random traffic at my 
box! doh!
anyway, here is what i'm currently using:

RewriteEngine on
RewriteCond  %{SERVER_PORT} !443
RewriteCond  %{REQUEST_URI} !/music
RewriteRule /(.*) https://%{HTTP_HOST}/$1 [R]

my mp3s are under /music and are handled by apache::mp3,

what i initially tried to do was have individual rewrite options for each 
</Directory> section such as:

<Directory /data/common_stuff/photos/bascule's_galleries>
        SetHandler      perl-script
        PerlHandler     Apache::Gallery
        .........snipping lots of stuff........
        AuthUserFile /etc/httpd/conf/auth/passwords
        AuthGroupFile /etc/httpd/conf/auth/groups
        Require group bascules_photos

       RewriteEngine on
       RewriteCond  %{SERVER_PORT} !443
       RewriteRule /pics/(.*) https://%{HTTP_HOST}/$1 [R]

</Directory>
Alias /pics /data/common_stuff/photos/bascule's_galleries

the above didn't work, i kept getting 'permission denied' errors, can anyone 
suggest where i am going wrong in a rewrite rule just for a </Directory> 
section?

bascule
-- 
Somehow, trying to get Granny Weatherwax and 'panty raid' into the same
sentence is beyond me.
(alt.fan.pratchett)



More information about the Swlug mailing list