Skip to main content

Redirecting Domains

This runbook provides details of approaches to redirecting domains. There are different approaches depending on the scenario. Use this guide to identify the most suitable approach.

Why might we need to redirect a domain?

There are a number of scenarios in which we may want to redirect a domain:

  • decommissioning of a service
  • replacement of a non-gov.uk domain with a gov.uk domain
  • migration of a service from one domain name to a new domain name
  • migration of a service to gov.uk

CNAME redirection

This is the simplest form of redirect. You can use a CNAME record to redirect one domain to another e.g. redirect example.service.justice.gov.uk to example.justice.gov.uk.

This approach won’t work where a CNAME shares the name with it’s Hostedzone e.g. you can’t create a CNAME example.justice.gov.uk in the Hostedzone example.justice.gov.uk. In this case you will need to redirect using AWS S3.

Redirection with AWS S3 (HTTP traffic)

A more complex form of redirect will involve using AWS S3 to ‘host’ your redirection. This process involves creating a public S3 bucket which contains a website redirect. This is a standard feature of AWS S3.

Follow the AWS documentation to set this up.

Few things to note when creating a redirect:

  • S3 buckets are created in the MoJDSD AWS account
  • This type of redirect won’t work for HTTPS traffic. Instead see Redirection with AWS S3 (HTTPS traffic)

Redirection with AWS S3 (HTTPS traffic)

A more complex form of redirect involving AWS S3. This type of redirect needs to be used where a service needs to process traffic over HTTPS. This type of redirect needs to include a TLS certificate, but that in turn needs the use of AWS CloudFront. This type is more complex as it needs creation of more AWS resources.

Follow the AWS documentation to set this up.

Few things to note when creating a redirect:

  • All AWS resources are created in the MoJDSD AWS account.

Redirection to gov.uk

This approach is required for services that are being transitioned to gov.uk. This approach users a redirection service offered by GDS.

Redirection to MoJ Maintenance Pages

This approach can be used for decommissioned domains or for services that need to be taken down for prolonged periods of time. This approach uses a custom created “maintenance page” that is hosted on the Cloud Platform.

This page was last reviewed on 5 June 2024. It needs to be reviewed again on 5 September 2024 by the page owner #operations-engineering-alerts .
This page was set to be reviewed before 5 September 2024 by the page owner #operations-engineering-alerts. This might mean the content is out of date.