<ruleset name="UK Local Government" platform="mixedcontent">
  <!--
    These are rules for local government in the UK.
    Council websites are foo.gov.uk domains.
    Often there are additional subdomains, for specific departments / apps
      eg: planning.southend.gov.uk, essexlibraries.essexcc.gov.uk
    There's no exhaustive list of subdomains, but local councils are listed at:
      http://www.direct.gov.uk/en/Dl1/Directories/Localcouncils/DG_4003594
  -->

  <!-- special and unusual cases go at the top to avoid the catch-all rule below -->

  <target host="www.hinckleyandbosworthonline.org.uk"/><target host="hinckleyandbosworthonline.org.uk"/>
  <target host="www.hinckley-bosworth.gov.uk"/><target host="hinckley-bosworth.gov.uk"/>
  <rule from="^http://(?:www\.)?(?:hinckleyandbosworthonline\.org\.uk|hinckley\-bosworth\.gov\.uk)/" to="https://www.hinckley-bosworth.gov.uk/"/>

  <target host="apps.southend.gov.uk"/>
  <rule from="^http://apps\.southend\.gov\.uk/" to="https://apps.southend.gov.uk/"/>

  <!-- a small number require redirect to secure.example.gov.uk -->

  <target host="broadland.gov.uk"/><target host="www.broadland.gov.uk"/>
  <target host="manchester.gov.uk"/><target host="www.manchester.gov.uk"/>
  <target host="monmouthshire.gov.uk"/><target host="www.monmouthshire.gov.uk"/>
  <target host="northwarks.gov.uk"/><target host="www.northwarks.gov.uk"/>
  <rule
    from="^http://(?:www\.)?(broadland\.gov\.uk|kettering\.gov\.uk|manchester\.gov\.uk|monmouthshire\.gov\.uk|northwarks\.gov\.uk)/"
    to="https://secure.$1/"/>

  <!-- all the remainder use www.example.gov.uk as http and https -->

  <target host="aberdeencity.gov.uk"/><target host="www.aberdeencity.gov.uk"/>
  <target host="aberdeenshire.gov.uk"/><target host="www.aberdeenshire.gov.uk"/>
  <target host="angus.gov.uk"/><target host="www.angus.gov.uk"/>
  <target host="bassetlaw.gov.uk"/><target host="www.bassetlaw.gov.uk"/>
  <target host="bathnes.gov.uk"/><target host="www.bathnes.gov.uk"/>
  <target host="blackpool.gov.uk"/><target host="www.blackpool.gov.uk"/>
  <target host="bournemouth.gov.uk"/><target host="www.bournemouth.gov.uk"/>
  <target host="bradford.gov.uk"/><target host="www.bradford.gov.uk"/>
  <target host="braintree.gov.uk"/><target host="www.braintree.gov.uk"/>
  <target host="brent.gov.uk"/><target host="www.brent.gov.uk"/>
  <target host="burnley.gov.uk"/><target host="www.burnley.gov.uk"/>
  <target host="calderdale.gov.uk"/><target host="www.calderdale.gov.uk"/>
  <target host="camden.gov.uk"/><target host="www.camden.gov.uk"/>
  <target host="canterbury.gov.uk"/><target host="www.canterbury.gov.uk"/>
  <target host="ceredigion.gov.uk"/><target host="www.ceredigion.gov.uk"/>
  <target host="charnwood.gov.uk"/><target host="www.charnwood.gov.uk"/>
  <target host="cherwell.gov.uk"/><target host="www.cherwell.gov.uk"/>
  <target host="cheshireeast.gov.uk"/><target host="www.cheshireeast.gov.uk"/>
  <target host="cityoflondon.gov.uk"/><target host="www.cityoflondon.gov.uk"/>
  <target host="derby.gov.uk"/><target host="www.derby.gov.uk"/>
  <target host="devon.gov.uk"/><target host="www.devon.gov.uk"/>
  <target host="doncaster.gov.uk"/><target host="www.doncaster.gov.uk"/>
  <target host="dover.gov.uk"/><target host="www.dover.gov.uk"/>
  <target host="dudley.gov.uk"/><target host="www.dudley.gov.uk"/>
  <target host="dundeecity.gov.uk"/><target host="www.dundeecity.gov.uk"/>
  <target host="easthants.gov.uk"/><target host="www.easthants.gov.uk"/>
  <target host="eastlothian.gov.uk"/><target host="www.eastlothian.gov.uk"/>
  <target host="east-northamptonshire.gov.uk"/><target host="www.east-northamptonshire.gov.uk"/>
  <target host="eastriding.gov.uk"/><target host="www.eastriding.gov.uk"/>
  <target host="edinburgh.gov.uk"/><target host="www.edinburgh.gov.uk"/>
  <target host="elmbridge.gov.uk"/><target host="www.elmbridge.gov.uk"/>
  <target host="enfield.gov.uk"/><target host="www.enfield.gov.uk"/>
  <target host="essex.gov.uk"/><target host="www.essex.gov.uk"/>
  <target host="falkirk.gov.uk"/><target host="www.falkirk.gov.uk"/>
  <target host="fareham.gov.uk"/><target host="www.fareham.gov.uk"/>
  <target host="fenland.gov.uk"/><target host="www.fenland.gov.uk"/>
  <target host="fifedirect.org.uk"/><target host="www.fifedirect.org.uk"/>
  <target host="fylde.gov.uk"/><target host="www.fylde.gov.uk"/>
  <target host="gateshead.gov.uk"/><target host="www.gateshead.gov.uk"/>
  <target host="glasgow.gov.uk"/><target host="www.glasgow.gov.uk"/>
  <target host="gloucestershire.gov.uk"/><target host="www.gloucestershire.gov.uk"/>
  <target host="hackney.gov.uk"/><target host="www.hackney.gov.uk"/>
  <target host="hants.gov.uk"/><target host="www.hants.gov.uk"/>
  <target host="hastings.gov.uk"/><target host="www.hastings.gov.uk"/>
  <target host="herefordshire.gov.uk"/><target host="www.herefordshire.gov.uk"/>
  <target host="hertsdirect.org"/><target host="www.hertsdirect.org"/>
  <target host="hillingdon.gov.uk"/><target host="www.hillingdon.gov.uk"/>
  <target host="ipswich.gov.uk"/><target host="www.ipswich.gov.uk"/>
  <target host="islington.gov.uk"/><target host="www.islington.gov.uk"/>
  <target host="iwight.com"/><target host="www.iwight.com"/>
  <target host="kent.gov.uk"/><target host="www.kent.gov.uk"/>
  <target host="kettering.gov.uk"/><target host="www.kettering.gov.uk"/>
  <target host="kirklees.gov.uk"/><target host="www.kirklees.gov.uk"/>
  <target host="lbhf.gov.uk"/><target host="www.lbhf.gov.uk"/>
  <target host="leicestershire.gov.uk"/><target host="www.leicestershire.gov.uk"/>
  <target host="lincolnshire.gov.uk"/><target host="www.lincolnshire.gov.uk"/>
  <target host="london.gov.uk"/><target host="www.london.gov.uk"/>
  <target host="maidstone.gov.uk"/><target host="www.maidstone.gov.uk"/>
  <target host="merton.gov.uk"/><target host="www.merton.gov.uk"/>
  <target host="midlothian.gov.uk"/><target host="www.midlothian.gov.uk"/>
  <target host="miltonkeynes.gov.uk"/><target host="www.miltonkeynes.gov.uk"/>
  <target host="newcastle.gov.uk"/><target host="www.newcastle.gov.uk"/>
  <target host="n-kesteven.gov.uk"/><target host="www.n-kesteven.gov.uk"/>
  <target host="northdown.gov.uk"/><target host="www.northdown.gov.uk"/>
  <target host="north-herts.gov.uk"/><target host="www.north-herts.gov.uk"/>
  <target host="northnorfolk.org"/><target host="www.northnorfolk.org"/>
  <target host="nottinghamshire.gov.uk"/><target host="www.nottinghamshire.gov.uk"/>
  <target host="n-somerset.gov.uk"/><target host="www.n-somerset.gov.uk"/>
  <target host="pendle.gov.uk"/><target host="www.pendle.gov.uk"/>
  <target host="peterborough.gov.uk"/><target host="www.peterborough.gov.uk"/>
  <target host="redbridge.gov.uk"/><target host="www.redbridge.gov.uk"/>
  <target host="ribblevalley.gov.uk"/><target host="www.ribblevalley.gov.uk"/>
  <target host="richmondshire.gov.uk"/><target host="www.richmondshire.gov.uk"/>
  <target host="rochford.gov.uk"/><target host="www.rochford.gov.uk"/>
  <target host="rossendale.gov.uk"/><target host="www.rossendale.gov.uk"/>
  <target host="rother.gov.uk"/><target host="www.rother.gov.uk"/>
  <target host="rotherham.gov.uk"/><target host="www.rotherham.gov.uk"/>
  <target host="rugby.gov.uk"/><target host="www.rugby.gov.uk"/>
  <target host="ryedale.gov.uk"/><target host="www.ryedale.gov.uk"/>
  <target host="scotborders.gov.uk"/><target host="www.scotborders.gov.uk"/>
  <target host="sevenoaks.gov.uk"/><target host="www.sevenoaks.gov.uk"/>
  <target host="sheffield.gov.uk"/><target host="www.sheffield.gov.uk"/>
  <target host="slough.gov.uk"/><target host="www.slough.gov.uk"/>
  <target host="solihull.gov.uk"/><target host="www.solihull.gov.uk"/>
  <target host="somerset.gov.uk"/><target host="www.somerset.gov.uk"/>
  <target host="southampton.gov.uk"/><target host="www.southampton.gov.uk"/>
  <target host="southend.gov.uk"/><target host="www.southend.gov.uk"/>
  <target host="southglos.gov.uk"/><target host="www.southglos.gov.uk"/>
  <target host="southlanarkshire.gov.uk"/><target host="www.southlanarkshire.gov.uk"/>
  <target host="southwark.gov.uk"/><target host="www.southwark.gov.uk"/>
  <target host="staffordshire.gov.uk"/><target host="www.staffordshire.gov.uk"/>
  <target host="staffsmoorlands.gov.uk"/><target host="www.staffsmoorlands.gov.uk"/>
  <target host="stirling.gov.uk"/><target host="www.stirling.gov.uk"/>
  <target host="tandridge.gov.uk"/><target host="www.tandridge.gov.uk"/>
  <target host="tauntondeane.gov.uk"/><target host="www.tauntondeane.gov.uk"/>
  <target host="threerivers.gov.uk"/><target host="www.threerivers.gov.uk"/>
  <target host="tmbc.gov.uk"/><target host="www.tmbc.gov.uk"/>
  <target host="torbay.gov.uk"/><target host="www.torbay.gov.uk"/>
  <target host="uttlesford.gov.uk"/><target host="www.uttlesford.gov.uk"/>
  <target host="valeofglamorgan.gov.uk"/><target host="www.valeofglamorgan.gov.uk"/>
  <target host="walthamforest.gov.uk"/><target host="www.walthamforest.gov.uk"/>
  <target host="warrington.gov.uk"/><target host="www.warrington.gov.uk"/>
  <target host="wellingborough.gov.uk"/><target host="www.wellingborough.gov.uk"/>
  <target host="westdevon.gov.uk"/><target host="www.westdevon.gov.uk"/>
  <target host="west-lindsey.gov.uk"/><target host="www.west-lindsey.gov.uk"/>
  <target host="westminster.gov.uk"/><target host="www.westminster.gov.uk"/>
  <target host="westoxon.gov.uk"/><target host="www.westoxon.gov.uk"/>
  <target host="westsussex.gov.uk"/><target host="www.westsussex.gov.uk"/>
  <target host="wigan.gov.uk"/><target host="www.wigan.gov.uk"/>
  <target host="wirral.gov.uk"/><target host="www.wirral.gov.uk"/>
  <target host="wolverhampton.gov.uk"/><target host="www.wolverhampton.gov.uk"/>
  <target host="havering.gov.uk"/><target host="www.havering.gov.uk"/>
  <!--
  These are self-signed, but probably still work:
  <target host="coventry.gov.uk"/><target host="www.coventry.gov.uk"/>
  <target host="hartlepool.gov.uk"/><target host="www.hartlepool.gov.uk"/>
  <target host="lewes.gov.uk"/><target host="www.lewes.gov.uk"/>
  <target host="newcastle-staffs.gov.uk"/><target host="www.newcastle-staffs.gov.uk"/>
  <target host="telford.gov.uk"/><target host="www.telford.gov.uk"/>
  -->

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

  <!-- place additional rules at the top if you wish to avoid the catch-all rule above -->
</ruleset>
