<!-- XXX: Needs more testing -->
<ruleset name="GoogleServices">
  <target host="google.*" />
  <target host="google.com" />
  <target host="*.google.com" />
  <target host="google.co.*" />
  <target host="google.com.*" />
  <target host="www.google.*" />
  <target host="www.google.co.*" />
  <target host="www.google.com.*" />
  <target host="groups.google.de" />
  <target host="gmail.com" />
  <target host="www.gmail.com" />
  <target host="googlecode.com" />
  <target host="*.googlecode.com" />
  <target host="news.google.co.*" />
  <target host="news.google.com.*" />
  <target host="news.google.*" />
  <target host="appspot.com" />
  <target host="*.appspot.com" />
  <target host="pagead2.googlesyndication.com" />
  <target host="googleusercontent.com" />
  <target host="*.googleusercontent.com" />

  <exclusion pattern="^http://(news\.)?google\.com/newspapers" />
  <exclusion pattern="^http://(news\.)?google\.com/archivesearch" />

  <rule from="^http://spreadsheets\.google\.com/"
          to="https://spreadsheets.google.com/"/>
  <rule from="^http://docs\.google\.com/"
          to="https://docs.google.com/"/>
  <rule from="^http://groups\.google\.com/"
          to="https://groups.google.com/"/>
  <rule from="^http://groups\.google\.de/"
           to="https://groups.google.de/"/>
  <rule from="^http://mail\.google\.com/"
           to="https://mail.google.com/"/>
  <rule from="^http://(www\.)?gmail\.com/"
          to="https://mail.google.com/"/>
  <rule from="^http://(www\.)?google\.com/reader/"
          to="https://www.google.com/reader/"/>
  <rule from="^http://(www\.)?google\.com/webfonts"
          to="https://www.google.com/webfonts"/>
  <rule from="^http://code\.google\.com/"
          to="https://code.google.com/"/>
  <rule from="^http://sites\.google\.com/"
          to="https://sites.google.com/"/>

  <rule from="^http://(www\.)?google((\.com?)?(\.[^/@:][^/@:])?)/calendar"
          to="https://www.google$2/calendar" />

  <!-- This worked for a while but seems to be unstable
  <rule from="^http://(www\.)?google((\.com?)?(\.[^/@:][^/@:])?)/products"
          to="https://www.google$2/products" />
   -->

  <rule from="^http://(www\.)?google((\.com?)?(\.[^/@:][^/@:])?)/profiles"
          to="https://www.google$2/profiles" />

  <rule from="^http://news\.google((\.com?)?(\.[^/@:][^/@:])?)/news"
          to="https://www.google.com/news" />

  <rule from="^http://news\.google((\.com?)?(\.[^/@:][^/@:])?)/newshp"
          to="https://www.google.com/news" />

  <rule from="^http://news\.google((\.com?)?(\.[^/@:][^/@:])?)/$"
          to="https://www.google.com/news" />

  <rule from="^http://(www\.)?googlecode\.com/$"
          to="https://code.google.com/" />
  <rule from="^http://([^/:@]*)\.googlecode\.com/$"
          to="https://code.google.com/p/$1/" />
  <rule from="^http://([^/:@]*)\.googlecode\.com/(.+)"
          to="https://$1.googlecode.com/$2" />

  <rule from="^http://trends\.google\.com/"
          to="https://www.google.com/trends"/>
  <rule from="^http://(www\.)?google((\.com?)?(\.[^/@:][^/@:])?)/trends"
          to="https://www.google.com/trends"/>

  <rule from="^http://(www\.)?google\.com/finance"
          to="https://www.google.com/finance"/>
  <rule from="^http://(www\.)?google\.co\.uk/finance"
          to="https://www.google.co.uk/finance"/>
  <rule from="^https?://finance\.google\.com/"
          to="https://www.google.com/finance/"/>
  <rule from="^https?://finance\.google\.co\.uk/"
          to="https://www.google.co.uk/finance/"/>
  <rule from="^http://(www\.)?google\.com/phone/"
          to="https://www.google.com/phone/"/>
  <rule from="^http://feedburner\.google\.com/"
        to="https://feedburner.google.com/"/>
  <rule from="^http://appengine\.google\.com/"
	to="https://appengine.google.com/"/>
  <rule from="^http://([^@:\./]+\.)?appspot\.com/"
        to="https://$1appspot.com/"/>
  <rule from="^http://pagead2\.googlesyndication\.com/"
	  to="https://pagead2.googlesyndication.com/"/>
  <rule from="^http://googleusercontent\.com/"
	to="https://www.googleusercontent.com/"/>
  <rule from="^http://([^@:\./]+)\.googleusercontent\.com/"
	to="https://$1.googleusercontent.com/"/>

  <rule from="^http://(www\.)?google\.com/contacts"
          to="https://www.google.com/contacts"/>
  <rule from="^http://(www\.)?google\.co\.uk/contacts"
          to="https://www.google.co.uk/contacts"/>
  <rule from="^http://(www\.)?google\.co\.in/contacts"
          to="https://www.google.co.in/contacts"/>

  <rule from="^http://(www\.)?google(\.com?)?(\.[^/@:][^/@:])?/(css|intl|js|logos|tools|googleblogs)/"
	  to="https://www.google.com/$4/"/>
  <rule from="^http://(www\.)?google(\.com?)?(\.[^/@:][^/@:])?/(cse|custom)"
	  to="https://www.google.com/cse" />
  <rule from="^http://(www\.)?google(\.com?)?(\.[^/@:][^/@:])?/dictionary"
          to="https://www.google.com/dictionary"/>
  <rule from="^http://(www\.)?google(\.com?)?(\.[^/@:][^/@:])?/support/"
          to="https://www.google.com/support/"/>

  <rule from="^http://(www\.)?google\.com/newproducts/"
          to="https://www.google.com/newproducts/"/>
  <rule from="^http://(www\.)?google\.com/moderator/"
          to="https://www.google.com/moderator/"/>

  <!-- Note: This rule is NOT for the Google Images service, which is
       available via a redirect from http://www.google.com/images
       (with no slash), but rather for images used internally by
       Google, within http://www.google.com/images/ (with a slash).
       This fixes the mixed content warning on Google Dictionary. -->
  <rule from="^http://(www\.)?google(\.com?)?(\.[^/@:][^/@:])?/images/"
          to="https://www.google.com/images/"/>
</ruleset>
