Skip to main content

Application: bouncer

Handles traffic for sites that have transitioned to GOV.UK

Relevant manual pages


This is a Rack-based redirector. It serves 301s and 410s from mappings created by Transition.

Technical documentation

You can use the GOV.UK Docker environment to run the application and its tests with all the necessary dependencies. Follow the usage instructions to get started.

Use GOV.UK Docker to run any commands that follow.

Running the tests

bundle exec rake

Testing redirects

In order to test the redirect feature of this app, you can use a special domain. We will create a mapping from this fake domain to GOV.UK.

  1. Setup the Transition repo.

One of the seeded organisations will be “Cabinet Office”, which we will use in the next step.

  1. In the Transition app, under the Cabinet Office organisation, add a new site.
Abbreviated name: bouncer-redirect
TNA timestamp: 20141104112824
Global type: Redirect
… with Global new URL:

This will create the site in the shared Transition / Bouncer DB.

  1. Start the Bouncer app and go to

You should see that it redirects to GOV.UK, as specified in the site file.

Testing on staging environment

In contrast to other GOV.UK applications, Bouncer isn’t available at

This means that testing the application on our staging environment will require repointing the domains you wish to test by editing your computer’s host file to point them at Bouncer’s staging IP address. This should allow visiting the app in a web browser, for example. Alternatively, to make a request to our staging environment with curl:

curl -I -H"Host:"

Data storage

Lists of domain names, old URLs and URLs to redirect to are stored in a PostgreSQL database to which the application has read-only access.

Example application URLs

Here are some examples using a few of the many domain names which is served by Bouncer:

URL Description Serves a redirect to a page on GOV.UK Serves a 410 archive page Serves a 404 not found page Serves a sitemap of all redirects for the domain Serves a minimal robots.txt


MIT License