<!--
	Other Facebook rulesets:

		- Facebook_Studio.xml


	CDN buckets:

		- fbcdn-dragon-a.akamaihd.net
		- fbcdn-photos-a.akamaihd.net
		- fbcdn-profile-a.akamaihd.net
		- fbcdn-sphotos-a.akamaihd.net
		- fbcdn-sphotos-[a-h]-a.akamaihd.net
		- fbexternal-a.akamaihd.net
		- fbstatic-a.akamaihd.net
		- s-static.ak.facebook.com.edgekey.net
		- s-static.ak.fbcdn.net.edgekey.net
		- profile.ak.facebook.com.edgesuite.net 
		- dragon.ak.fbcdn.net.edgesuite.net
		- external.ak.fbcdn.net.edgesuite.net

		- photos-c.ak.facebook.com.edgesuite.net

			- photos-g.ak.fbcdn.net

		- photos-d.ak.facebook.com.edgesuite.net

			- photos-h.ak.fbcdn.net

		- static.ak.connect.facebook.com.edgesuite.net

	foo.ak.fbcdn.net	<=>	fb(cdn-)?foo-a.akamaihd.net


	Nonfunctional domains:

		investor.fb.com		(504, valid cert)


	Problematic domains:

		- facebook.com:

			- external.ak *
			- profile.ak *
			- connect *
			- www.connect	(shows www)

		- on.fb.me
		- dragon.ak.fbcdn.net *
		- photos-[a-h].ak.fbcdn.net	*

	* akamai


	Fully covered domains:

		- facebook.com subdomains:

			- (www.)
			- s-static.ak
			- b.s-static.ak
			- api
			- api-read
			- apps
			- connect
			- developers
			- graph
			- login
			- m
			- pixel
			- ssl
			- static-ak
			- www.v6
			- \w\w-\w\w 	(language-specific subdomains)

		- connect.facebook.net
		- newsroom.fb.com
		- on.fb.me

		- fbcdn.net subdomains:

			- dragon.ak		(→ fbcdn-dragon-a.akamaihd.net)
			- photos-[a-h].ak
			- s-static.ak

			- *.xx:

				- profile-a
				- profile-a-ord
				- scontent-02
				- scontent-b-ord
				- sphotos
				- sphotos-b

-->
<ruleset name="Facebook">

	<target host="facebook.*" />
	<target host="www.facebook.*" />
	<target host="*.facebook.com" />
	<target host="*.facebook.de" />
	<target host="*.facebook.dk" />
	<target host="*.facebook.es" />
	<target host="*.facebook.fr" />
	<target host="*.facebook.jp" />
	<target host="*.facebook.mx" />
	<target host="connect.facebook.net" />
	<target host="*.facebook.no" />
	<target host="*.facebook.se" />
	<target host="fb.com" />
	<target host="*.fb.com" />
	<target host="on.fb.me" />
	<target host="*.fbcdn.net" />


	<securecookie host="^(?:.*\.)?facebook\.com$" name="(?:c_user|lu|sct|xs)" />
    <securecookie host="^\.facebook\.com$" name=".+" />
	<securecookie host="^newsroom\.fb\.com$" name=".+" />

	<rule from="^https?://f(?:acebook|b)\.com/"
		to="https://www.facebook.com/" />

	<rule from="^https?://www\.f(?:acebook|b)\.com/"
		to="https://www.facebook.com/" />

	<rule from="^https?://(\w\w-\w\w|(?:b\.)?s-static\.ak|api|api-read|apps|badge|blog|connect|developers|graph|login|m|pixel|ssl|static-ak|www\.v6)\.facebook\.com/"
		to="https://$1.facebook.com/" />

	<!--	Also on fbstatic-a.akamaihd.net, but this is what the servers do.
								-->
	<rule from="^https?://static\.ak\.facebook\.com/"
		to="https://s-static.ak.facebook.com/" />

	<rule from="^http://www\.connect\.facebook\.com/"
		to="https://connect.facebook.com/" />

	<!--		Cert doesn't match and
		this is what the server does.
						-->
	<rule from="^https?://(?:www\.)?facebook\.(?:be|is|it|nl|us)/"
		to="https://www.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^https?://(?:de-de\.|fr-fr\.|www\.)?facebook\.(de|fr)/"
		to="https://$1-$1.facebook.com/"/>

	<!--	Ditto.
			-->
	<rule from="^https?://(?:da-dk\.|www\.)?facebook\.dk/"
		to="https://da-dk.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^https?://(?:es-es\.|www\.)?facebook\.(?:es|mx)/"
		to="https://es-es.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^https?://(?:ja-jp\.|www\.)?facebook\.jp/"
		to="https://ja-jp.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^https?://(?:nb-no\.|www\.)?facebook\.no/"
		to="https://nb-no.facebook.com/" />

	<!--	Ditto.
			-->
	<rule from="^https?://(?:sv-se\.|www\.)?facebook\.se/"
		to="https://sv-se.facebook.com/" />

	<rule from="^https?://connect\.facebook\.net/"
		to="https://connect.facebook.net/"/>

	<rule from="^https?://newsroom\.fb\.com/"
		to="https://newsroom.fb.com/" />

	<rule from="^https?://on\.fb\.me/"
		to="https://bit.ly/" />

	<rule from="^https?://dragon\.ak\.fbcdn\.net/"
		to="https://fbcdn-dragon-a.akamaihd.net/" />

	<!--	Akamai.
			-->
	<rule from="^https?://external\.ak\.fbcdn\.net/"
		to="https://fbexternal-a.akamaihd.net/" />

	<rule from="^https?://photos-([a-h])\.ak\.fbcdn\.net/"
		to="https://fbcdn-sphotos-$1-a.akamaihd.net/" />

	<rule from="^https?://profile\.ak\.fbcdn\.net/"
		to="https://fbcdn-profile-a.akamaihd.net/" />

	<rule from="^https?://(?:a\d\.)?sphotos\.ak\.fbcdn\.net/"
		to="https://fbcdn-sphotos-a.akamaihd.net/" />

	<!--	- Akamai
		- Data are also on static.facebook.com
							-->
	<rule from="^https?://(?:static\.connect|(?:s-)?static)\.ak\.fbcdn\.net/"
		to="https://s-static.ak.fbcdn.net/" />

	<rule from="^https?://([^@:\./]+)(\.xx)?\.fbcdn\.net/"
		to="https://$1$2.fbcdn.net/" />

	<!--	Bing maps. Should be generalized and moved at some point.

		Cert only matches *.tiles.virtualearth.net.
								-->
	<rule from="^https?://fb\.ecn\.api\.tiles\.virtualearth\.net/"
		to="https://api.tiles.virtualearth.net/" />

</ruleset>
