Adding a redirect or a short URL

Only people with the “admin” role can add or edit a redirect. You can request a redirect using this form.

Table of contents


Redirects for English-only content

First, see the Short URL guidance to learn how to create a good short URL.

  1. Click on Shortcuts, select Redirect, and then Add redirect button

     

  2. Add your short URL (or the URL to redirect) to Path.

    1. Note: The URL must not already exist for the redirect to work.

  3. Add the destination URL to To.

    1. If the destination is another page on SF.gov, you can search for the page’s title. The To field will autofill to that page’s title with node ID.

  4. Save.

Selecting “All languages” under Language means that all instances of the destination will redirect to English.

Getting to the “Add URL redirect” page
The settings to add a URL redirect

For redirects to translated pages

You have to assign languages for each of the redirects, including English. For non-English languages, Drupal will automatically add /zh-hant/ /es/ /fil/to the short URL.

The destination URL should be the full URL of the translated page.


Redirecting pages slated to be archived or deleted

Set up the redirect before you archive or delete pages.

You have to find the page’s node number to put into the Path field.

Method 1: Refer to the node ID

This method works even if the page is unpublished.

  1. Search for the page title on https://sf.gov/admin/content.

  2. Refer to the number in the ID column. This is the node ID.

  3. Go to the Add URL redirect page.

  4. Add the node ID to the Path as follows: node/[IDnumber]. Ignore the warning.

  5. Choose your destination page or URL.

  6. Save the URL redirect

  7. Archive or delete your page.

This method only works if the page is published.

  1. Create an Information page and enter in some text into the Drupal text editing field.

  2. Select the text and then select the Link button.

  3. Start typing your page’s title into the URL field and select the correct page.

  4. Copy the URL that appears in the URL field. This is the page’s node number.

  5. Go to the Add URL redirect page.

  6. Paste the URL into the Path field and delete the first slash. Ignore the warning.

  7. Choose your destination page or URL.

  8. Save the URL redirect

  9. Archive or delete your page.

Updating a redirect for an archived page

  1. Search for your page title

  2. Find the node ID on the Content screen.

  3. Search for the node ID on https://sf.gov/admin/config/search/redirect

  4. Edit the redirect

  5. Update the destination URL.

  6. Save