-
Notifications
You must be signed in to change notification settings - Fork 8
Redirects
Redirects are handled through the Sanity CMS by creating a new redirect document. All redirects created are permanent redirects. To create a new redirect:
- Type in the old slug without the domain, starting with
/
, in theFrom
field. Example:/this-is-an/example
- In the
To
field, select the Page that the redirect should link to
Redirects to a different domain are handled in Sanity, under the Settings > External Redirects
menu item.
Different domain redirects are handled in the DNS and in the code.
A dedicated team is responsible for doing so, and this can be requested by creating a new ticket in 'service now'.
If an external redirect should be redirected to a specific slug, the logic also needs to be added to the code at: https://github.com/equinor/energyvision/blob/main/web/common/helpers/redirects.ts
All slugs ending with .html
are automatically permanently redirected to the same slug without the .html
. Example: /this-is-another/example.html
is automatically redirected to /this-is-another/example
All slugs starting with /news
that do not exist in Sanity are redirected to (fallbacks to) /news/archive
All slugs that aRe NoT LoWeRCaSed (except slugs from archived news) are redirected to their lower cased version.
Slugs from assets before 2016 are redirected to /content/dam/archive-assets/${locale}${pathname}
#1399
The file located at /content/dam/statoil/documents/supply-chain/statoil-deposit-enrollment-form.pdf
redirects to /where-we-are/us-owner-relations
#1468
Some of the redirect logic is implemented in the file middleware.ts. Rest is in the redirect.js file which is imported to next config
- Home
- The team
- How we work
- Retrospectives
- GitHub Actions
- Satellite sites
- Redirects
- Groups / Accesses / Sites
- Migrate production data to test
- Guide to upgrading dependencies