<!--
	Wikipedia and other Wikimedia Foundation wikis previously had no real HTTPS support, and
	URLs had to be rewritten to https://secure.wikimedia.org/$wikitype/$language/ . This is no
	longer the case, see https://blog.wikimedia.org/2011/10/03/native-https-support-enabled-for-all-wikimedia-foundation-wikis/ ,
	so this file is a lot simpler these days.

-->
<ruleset name="Wikimedia">

	<target host="enwp.org" />
	<target host="frwp.org" />

	<target host="mediawiki.org" />
	<target host="www.mediawiki.org" />
	<target host="wikimedia.org" />
	<target host="*.wikimedia.org" />
		<exclusion pattern="^http://(?:apt|brewster|bug-attachment|cs|cz|dataset2|download|ekrem|emery|labs-ns0|labs-ns1|search|status|sitemap|torrus|ubuntu|virt0)\.wikimedia\.org" />
		<!-- https://mail1.eff.org/pipermail/https-everywhere-rules/2012-June/001189.html -->
		<exclusion pattern="^http://lists\.wikimedia\.org/pipermail(?:$|/)" />
	<target host="wikimediafoundation.org" />
	<target host="www.wikimediafoundation.org" />

	<!-- Wikimedia projects (also some wikimedia.org subdomains) -->
	<target host="wikibooks.org" />
	<target host="*.wikibooks.org" />
	<target host="wikidata.org" />
	<target host="*.wikidata.org" />
	<target host="wikinews.org" />
	<target host="*.wikinews.org" />
	<target host="wikipedia.org" />
	<target host="*.wikipedia.org" />
		<exclusion pattern="^http://(?:download|static)\.wikipedia\.org/" />
	<target host="wikiquote.org" />
	<target host="*.wikiquote.org" />
	<target host="wikisource.org" />
	<target host="*.wikisource.org" />
	<target host="wikiversity.org" />
	<target host="*.wikiversity.org" />
	<target host="wikivoyage.org" />
	<target host="*.wikivoyage.org" />
	<target host="wiktionary.org" />
	<target host="*.wiktionary.org" />

	<!-- Wikimedia chapters -->
	<target host="wikimedia.ca" />
	<target host="www.wikimedia.ca" />

	<!-- Wikimedia Tool Labs -->
	<target host="tools.wmflabs.org" />
	<target host="icinga.wmflabs.org" />
	<target host="ganglia.wmflabs.org" />

	<securecookie host="^([^@:/]+\.)?wik(ibooks|idata|inews|ipedia|iquote|isource|iversity|ivoyage|tionary)\.org$" name=".*" />
	<securecookie host="^(species|commons|meta|incubator|wikitech).wikimedia.org$" name=".*" />
	<securecookie host="^(?:www\.)?mediawiki\.org$" name=".*" />
	<securecookie host="^wikimediafoundation.org$" name=".*" />

	<rule from="^http://(en|fr)wp\.org/"
		to="https://$1.wikipedia.org/wiki/" />

	<rule from="^http://(?:www\.)?mediawiki\.org/"
		to="https://www.mediawiki.org/" />

	<rule from="^http://([^@:/]+\.)?wik(ibooks|idata|imedia|inews|ipedia|iquote|isource|iversity|ivoyage|tionary)\.org/"
		to="https://$1wik$2.org/" />

	<rule from="^http://([^@:/]+)\.planet\.wikimedia\.org/"
		to="https://$1.planet.wikimedia.org/" />

	<rule from="^http://(www\.)?wikimediafoundation\.org/"
		to="https://$1wikimediafoundation.org/" />

	<rule from="^http://(www\.)?wikimedia\.ca/"
		to="https://wikimedia.ca/" />

	<rule from="^http://(tools|icinga|ganglia)\.wmflabs\.org/"
		to="https://$1.wmflabs.org/" />
</ruleset>
