<!-- www.wikisomething.org is generally a valid
     domain containing general information on a project and is
     simply not available at all in HTTPS.  Everything with a /wiki
     suffix, however, is a language-specific page that is available in
     HTTPS.  Hence these rules avoid redirecting www.wikisomething.org,
     while redirecting all language-specific subdomains.  If you
     navigate first to the WWW page, you could be vulnerable to SSL
     stripping, but if you succeed in submitting a query from there
     in a specific language without interference, you'll subsequently
     be protected.  -->

<ruleset name="Wikipedia">
  <target host="*.wikipedia.org" />
  <target host="*.wikinews.org" />
  <target host="*.wikisource.org" />
  <target host="*.wikibooks.org" />
  <target host="*.wikiquote.org" />
  <target host="*.wikiversity.org" />
  <target host="*.wiktionary.org" />
  <target host="*.wikimedia.org" />

  <exclusion pattern="^http://www\.wik(ipedia|inews|isource|ibooks|iquote|iversity|tionary)\.org/"/>
  <rule from="^http://([^@:/]+)\.wik(ipedia|inews|isource|ibooks|iquote|iversity|tionary)\.org/(w|wiki)/"
          to="https://secure.wikimedia.org/wik$2/$1/$3/"/>
  <rule from="^http://([^@:/]+)\.wik(ipedia|inews|isource|ibooks|iquote|iversity|tionary)\.org/?$"
          to="https://secure.wikimedia.org/wik$2/$1/wiki/"/>

  <rule from="^http://(meta|commons|incubator|species|outreach|strategy|usability|wikimania|test|survey)\.wikimedia\.org/wiki/"
          to="https://secure.wikimedia.org/wikipedia/$1/wiki/"/>

  <rule from="^http://([^@:/]+)\.wik(ipedia|inews|isource|ibooks|iquote|iversity|tionary)\.org/w/index\.php\?title="
          to="https://secure.wikimedia.org/wik$2/$1/wiki/"/>

  <rule from="^http://bugzilla\.wikimedia\.org/"
          to="https://bugzilla.wikimedia.org/"/>

</ruleset>
