I'm trying to get the https on/off working via mod rewrite but it doesn't seem to work. I can get https to turn on when the user logs on but if I try turning it off then the logon fails.
apache 2.2.3
in httpd.conf.local
alias doku /path/to/my/wiki
in wiki.conf (/etc/apache2/conf.d)
RewriteCond %{SERVER_PORT} !443
RewriteCond %{QUERY_STRING} do=log
RewriteRule ^(.*) https://%{HTTP_HOST}/doku/$1 [R,QSA,L]
#RewriteCond %{SERVER_PORT} 443
#RewriteCond %{QUERY_STRING} !do=log
#RewriteRule ^(.*) http://%{HTTP_HOST}/doku/$1 [R,QSA,L]
in /path/to/my/wiki/conf/local.php
$conf['userrewrite'] = '1';
If I go to www.myserver.com/doku I get the start page with the login button.
I click on the login button and I get switched to https
https://www.myserver.com/doku/Home?do=login
when I click on login using username and password I go to
https://www.myserver.com/doku/home and I see the buttons for subscribe changes, admin, etc so it all works but I'm using https for everything.
If I uncomment the 3 Rewrite rules that switch HTTPS off (and restart apache) I still properly switch from http to https when I click on the login button on the start page but after putting in username and password and clicking login button I'm taken to
http://www.myserver.com/doku/doku.php
and it's like I've never logged in
thanks for any ideas?