Skip to content

Commit 68fe222

Browse files
authored
Adde redirect for data.equinor.com #3451 (#3452)
1 parent a2a1f37 commit 68fe222

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

web/common/helpers/redirects.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,8 @@ const dnsRedirects = [
9999
from: 'morgendagenshelter.no',
100100
to: '/no/om-oss/sponsing-og-stotte',
101101
},
102+
{
103+
from: "data.equinor.com",
104+
to:"/energy/data-sharing"
105+
}
102106
]

web/middleware.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ const PERMANENT_REDIRECT = 301
1111
const PUBLIC_FILE = /\.(.*)$/
1212
const DOT_HTML = '.html'
1313
const IS_ARCHIVED_NEWS_DOWNLOADS = /(.*)\/news\/archive\/[0-9]{4}\/[0-9]{2}\/[0-9]{2}\/downloads\/(.*)\.(.*)$/
14+
const wwwExcludedDomains = ['localhost:3000',process.env.RADIX_PUBLIC_DOMAIN_NAME,process.env.RADIX_CANONICAL_DOMAIN_NAME,'data.equinor.com']
1415

1516
// Check if a given path exists in Sanity or not
1617
const pathExistsInSanity = async (pathname: string, isPreview = false): Promise<boolean> => {
@@ -59,9 +60,7 @@ export async function middleware(request: NextRequest) {
5960

6061
// Skip WWW redirect for Radix URLs and localhost
6162
if (
62-
host !== process.env.RADIX_PUBLIC_DOMAIN_NAME &&
63-
host !== process.env.RADIX_CANONICAL_DOMAIN_NAME &&
64-
host !== 'localhost:3000'
63+
!wwwExcludedDomains.includes(host)
6564
) {
6665
const wwwRedirect = getWWWRedirect(host, pathname)
6766
if (wwwRedirect) {

0 commit comments

Comments
 (0)