-
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.
There is a dedicated team responsible for doing so, and this can be request 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 redirect to (fallbacks to) /news/archive
All slugs that aRe NoT LoWeRCaSed (except slugs from archived news) are redirected to its lower cased version.
The whole logic is implemented in the file _middleware.ts. In the future we should look into refactoring/moving this logic into next.config.js
for performance reasons.
- Home
- The team
- How we work
- Retrospectives
- GitHub Actions
- Satellite sites
- Redirects
- Groups / Accesses / Sites
- Migrate production data to test
- Guide to upgrading dependencies