Tool to request, approve and create short URL redirects on GOV.UK
Ruby HTML CSS Shell
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
app Replace require_signin_permission! Apr 4, 2018
bin Update config files for new Rails version. Dec 12, 2016
config Ignore a warning about dynamic render paths Aug 9, 2018
db Remove details from /design-principles/style-guide.atom gone item Nov 17, 2017
lib Allow a redirect to be edited if the advanced options change Oct 23, 2017
log Blank Rails 4.1.4 app Jul 8, 2014
public Blank Rails 4.1.4 app Jul 8, 2014
spec Use the new external_url_for method in Plek Feb 9, 2018
.gitignore Ignore my local Aug 5, 2014
.rspec Add rspec 3 Jul 8, 2014
.rubocop.yml Fix ruby lint errors Feb 13, 2017
.ruby-version Bump to ruby-2.5.1 May 29, 2018
Gemfile Bump uglifier from 4.1.17 to 4.1.18 Aug 10, 2018
Gemfile.lock Merge pull request #234 from alphagov/dependabot/bundler/uglifier-4.1.18 Aug 15, 2018
Jenkinsfile Update Jenkinsfile to use external library Mar 2, 2018
LICENCE Add LICENCE Apr 12, 2016 Merge pull request #100 from alphagov/fix-technical-documentation-rea… Oct 19, 2017
Rakefile Stop using ci_reporter Jan 16, 2017 Blank Rails 4.1.4 app Jul 8, 2014 Change default govuk-content-schemas branch Nov 22, 2016 Use correct port in ./ Jul 8, 2014

Short URL manager

Publishing tool to request, approve and create Short URLs on GOV.UK.

Technical documentation

Short URLs are a short and easy to type URL that redirects to a piece of content at a much longer URL.

They are often used on posters, in leaflets or over the phone, so they are easy to use. For example:




Currently this tool allows departmental users to request redirects within the scope of their department, eg, under dwp above. Future versions may add workflow for requesting/managing top level Short URLs, eg, /ebola to /government/topical-events/ebola-government-response.


  • MongoDB - main data store
  • Redis - for distributed locking using mlanett/redis-lock
  • alphagov/gds-sso: Provides authentication OmniAuth adapter to allow apps to sign in via GOV.UK auth
  • alphagov/publishing-api: the central store of published content on GOV.UK. Once a redirect has been accepted, redirects are registered to this API.

Running the application

$ ./

If you are using the GDS development virtual machine then the application will be available on the host at

Running the test suite

$ bundle exec rake

Content Schema Validations

You will need a copy of govuk-content-schemas on your file system. By default these should be in a sibling directory to your project. Alternatively, you can specify their location with the GOVUK_CONTENT_SCHEMAS_PATH environment variable.


Users must be given Signon permissions to access and use the features of this tool. The available permissions are:

  • request_short_urls: Can complete a form to request a new Short URL, which must be approved before being made
  • manage_short_urls: Can approve requests for Short URLs, and create the redirects on GOV.UK
  • receive_notifications: Will receive email notifications when a new short URL is requested.
  • advanced_options: Can create and approve requests using advanced options (prefix type redirects, and non-default segments mode values).


MIT License