[Mediawiki-l] Plugin: Require HTTPS for SpecialUserlogin

Jason Young jason.young at extension.org
Tue Aug 14 21:21:57 UTC 2007

Until we can get all our wikis moved to OpenID - this is what we've  
been doing using Apache's mod_rewrite.

In the <Directory /> config for the MediaWiki for the port 80 vhost  

                 RewriteEngine On
                 RewriteCond %{SERVER_PORT} !^443$
                 RewriteCond %{QUERY_STRING} .*Special:Userlogin.* [NC]
                 RewriteRule ^.*$ https://%{SERVER_NAME}% 

                 RewriteCond %{SERVER_PORT} !^443$
                 RewriteCond %{REQUEST_URI} .*Special:Userlogin.* [NC]
                 RewriteRule ^.*$ https://%{SERVER_NAME}% 

For the port 443 vhost conf:

                 RewriteEngine on
                 RewriteCond %{QUERY_STRING} !.*Special:Userlogin.*
                 RewriteCond %{QUERY_STRING} !.*MediaWiki:.*
                 RewriteCond %{QUERY_STRING} !.*title=-.*
                 RewriteCond %{REQUEST_URI} !.*Special:Userlogin.*
                 RewriteCond %{REQUEST_URI} !.*skins/.*
		RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [L,R]


On Aug 14, 2007, at 1:26 PM, Thomas Dalton wrote:

> Is there any way to do this in the server configuration, rather than
> in MediaWiki? Just tell the server to always use https for that
> particular page. (This may well be impossible, especially since the
> request is initiated by the user, not the server, but if it's
> possible, it would be easier than hacking MediaWiki.)
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l

Jason Young --  Systems Manager, eXtension

More information about the MediaWiki-l mailing list