can you count the letter * in:
q: how to force ssl (https) on apache location im trying to force ssl (https) on an svn repository served by mod_dav_svn.  heres what i have:
<location /svn/projectname>
  dav svn
  svnpath /var/repo/projectname
  require valid-user
  authtype basic
  authname subversion repository
  authuserfile /etc/svn-auth-projectname

  #heres what i tried (didnt work)
  sslciphersuite high:medium
</location>

however, i dont get redirected to https when i log in via http; it stays in http.  why doesnt the above work?  how do i get this https redirect to work?
ive seen suggestions about using mod_rewrite, e.g.:
# /dir/.htaccess
rewriteengine on
rewritecond %{server_port}!443
rewriterule ^(.*)$ https://www.x.com/dir/$1 [r,l] 

however, i dont understand exactly what this does, so im afraid to use it.  plus, it looks more like an ugly hack than the correct solution.

a: its not a hack. heres a quick breakdown for you:
# turn on rewriting
rewriteengine on 

# apply this rule if request does not arrive on port 443
rewritecond %{server_port} !443 

# regex to capture request, url to send it to (tacking on the captured text, stored in $1), redirect it, and oh, im the last rule.
rewriterule ^(.*)$ https://www.x.com/dir/$1 [r,l]


a: we use a slightly different, but mostly equivalent syntax. rather than checking the port the request was received on, we check that https isnt being used. and we use the %{http_host} environment variable rather than hardcoding the host name.
  rewriteengine              on
  rewritecond     %{https}   off
  rewriterule     .*         https://%{http_host}%{request_uri} [r,l]

i like this approach a little better, because it works when apache is listening on non-standard ports. there could be a problem with using %{http_host} if your site is behind a proxy, but we havent tried that yet.

a: try 
 <location />
    sslrequiressl
 </location>


a: we define everything with name virtual hosts.  then, if you are within a <virtualhost *:80> definition, you dont have to check if it is not port 443, you already know its not.  you can then just force everything that hits 80 over to 443 with a rule like:
rewriteengine on
rewriterule ^(.)$ https://www.yourdomain.com/$1 [r,l]


a: additionally to the already mentioned redirect you might want to add the sslrequiressl directive to your location container which will deny access if you do not use an https connection. however, the solution with a virtualhost for your svn site which only listens on *:443 is more elegant.

a: assuming apache 2:
youve done everything except actually enable ssl by the looks of things.  use the sslengine, sslcertificatefile, and sslcertificatekeyfile commands, as described here:
youll need to generate and/or buy an the pki files (ssl certificate and related private key file) for the sslcertificate*file commands.
http://www.debianhelp.co.uk/apacheinstall.htm
# /dir/.htaccess
1. rewriteengine on
2. rewritecond %{server_port}!443
3. rewriterule ^(.*)$ https://www.x.com/dir/$1 [r,l]

this says:


*

*enable url redirection and rewriting support

*for all connections that dont come through port 443 (in other words, all non-ssl connections)

*redirect them to the same page under https://www.x.com/dir/.  so if they ask for http://www.x.com/y, theyll be redirected to x under the ssl servers dir: https://www.x.com/dir/x
if your site supports ssl now, and youre just trying to force ssl on the svn subdirectory, you might try something like:
1. rewriteengine on
2. rewritecond %{server_port}!443
3. rewriterule ^/svn/(.*)$ https://www.x.com/svn/$1 [r,l]

which would do the same as above, but only for stuff under the subversion directory.

a: what you want to do is to force a redirect to https for regular web connections. the rewrite rules seem to accomplish that. that is not an ugly hack but rather the correct way to do it. your present configuration does not force a redirect.

a: use sslrequiressl in location block 

user
The text includes 12 "*"s in total.
assistant