-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 1/22/2014 10:27 AM, Al wrote:
I have SSL setup and working with apache and can
browse the site with http or https, but does anyone know how to make mediaWiki switch to
https when logging on? Or, at the very least, switch temporarily just for the login?
I'm not sure if this is the "right" way of doing things (it doesn't
take
into account non-English languages, but I run an English-only wiki), but
I managed to do this with mod_rewrite. Note that I use short URLs (path
/wiki/, with the "raw" path being /wikix/):
<IfModule mod_ssl.c>
RewriteCond %{HTTPS} ^off$
RewriteCond %{REQUEST_URI} ^/wikix/
RewriteCond %{QUERY_STRING} title=Special:UserLogin
RewriteRule ^/wikix/(.*) https://%{HTTP_HOST}/wikix/$1 [R,L]
RewriteCond %{HTTPS} ^off$
RewriteRule ^/wiki/Special:UserLogin
https://%{HTTP_HOST}/wiki/Special:UserLogin [R,L]
</IfModule>
The first set of rules captures the query string version of the request,
while the second set captures the short URL version. Also note that, in
my experience, once the wiki has been put in HTTPS mode, it tends to
like to stay there. I'm not sure if it's my configuration (I didn't
explicitly set it this way), but if I try to force it to go back to
HTTP, it "forgets" that I'm logged in, so I'm assuming it's setting
the
login cookie as HTTPS-only.
Hope this helps.
- --
Jeffrey T. Darlington
General Protection Fault
http://www.gpf-comics.com/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (MingW32)
Comment: Using GnuPG with Thunderbird -
http://www.enigmail.net/
iQIcBAEBAgAGBQJS3+aOAAoJEL0jB69czAo6qJMP/1JPqTlQReiufcmfmZ4+SggW
OEDZnqYK7iydlJXsXownFORdKkNptmEJpYHBZLKcxMiaBcigbqgo2yYOfbKKRW65
ZnjcfuuOydPwTg6osQ9eSRXKlOZH5qdmYIO6kXXDS4OfBE0gny+mIMpMIqhK5cpF
q8xKMlwmNkWZROOchNeEDUNEVGscT14F789x5wa/Oy2z6sEh1CJHOekr8oJoT1HP
dnfHiKBvCoAsWEoNpO1WV4XRiZWQoqgNI4zumHFGq2SbRKpJrx4lrtOSpXyMOGnq
8p73wfU6UzaB2hZUY34PbgTNzII0B8jE+DtPpBVxY/zkiCoI5Wzb2osPQHKy6ED4
iqRhl0PRiyL4sqGi4waki5gGqgolCRazIpQr+k1Takv18QGNwyLAiHwJ/Yo2sg8L
KI7v0DlOu8aUev125qlAdjrI55lIqFxz9uH1s4f/Su0Oy0vWx2rTgOMZ2z5xM2Kf
Ufm89M0v1DI46h0XVGZmq7SivQPygwJLYWCdywTKOe74ThW4N3fKdPUu1vvxAyUI
VyTxXD1UZVyxKCE3VFpghp7gpK2vDMavfsJElU6PBJgdBwJ8/SNOTdlve67hZKk/
Er9ivty6tC+NCnYFweWXjrTX5aqFdAfTJuHsCFJZYNaePxfWFAtCEUxDogSWYRzR
lx2uCPHBAV4TwdnLJ8zB
=1a7S
-----END PGP SIGNATURE-----