Table of contents

Change a slug and create redirect in Whitehall

Change a slug and create redirect in Whitehall

Whitehall

A Rake Tasks exists in Whitehall to quickly change the slug of a Document. It also reindexes the Document with it’s new slug, republishes the document to Publishing API, which automatically handles the redirect.

The task takes the Document’s old slug and the Document’s new slug.

$ bundle exec 'reslug:document[old_slug,new_slug]'

Jenkins - integration

This rake task also works for Person, Role, PolicyGroup, Organisation, WorldOrganisation and WorldLocation. For example: reslug:world_location[old_slug,new_slug]

This page was last reviewed on 29 April 2019. It needs to be reviewed again on 29 October 2019 by the page owner #govuk-2ndline .
This page was set to be reviewed before 29 October 2019 by the page owner #govuk-2ndline. This might mean the content is out of date.