How to redirect http to https with Apache/SVN/SSL

Patrick W. Barnes nman64 at n-man.com
Sun May 10 23:30:50 UTC 2009


On Sunday 10 May 2009 17:57:15 Daniel B. Thurman wrote:
> I am trying to solve one last problem with my
> Apache/SVN/SSL with http to http redirection.
>
> Is it possible to do?
>
> Here is what I have in my subversion.conf file:
> =======================================
> <VirtualHost host.domain.com:80>
>     ServerName host.domain.com
>     RequestHeader edit Destination ^http https early
>     #Redirect / https://host.domain.com/
> </VirtualHost>
>
> <VirtualHost host.domain.com:443>
>     [...]
> </VirtualHost>
> =======================================
>
> Using the following works:
> $ svn list https://host.domain.com/svn/svn1
> branches/
> tags/
> trunk/
>
> But using the following with either RequestHeader or Redirect fails:
> $ svn list http://host.domain.com/svn/svn1
> svn: PROPFIND request failed on '/svn/svn1'
> svn: PROPFIND of '/svn/svn1': 405 Method Not Allowed
> (http://host.domain.com)
>
> Is there a way to make this work?
>

<VirtualHost host.domain.com:80>
    ServerName host.domain.com
    ...
    RewriteEngine On
    RewriteRule ^/$ https://host.domain.com/ [R,L]
    RewriteRule ^/(.*) https://host.domain.com/$1 [R,L]
</VirtualHost>

Note the second rewrite rule, which allows anything not simply pointing at the 
root location to also be redirected, maintaining the rest of the URL.

-- 
Patrick "The N-Man" Barnes
nman64 at n-man.com

http://n-man.com/

LinkedIn:
http://linkedin.com/in/nman64

Have I been helpful?  Rate my assistance!
http://rate.affero.net/nman64/

All messages cryptographically signed:
http://en.wikipedia.org/wiki/OpenPGP
-- 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/fedora-list/attachments/20090510/ee6dec11/attachment-0001.sig>


More information about the fedora-list mailing list