Skip to content

Commit

Permalink
Default to permanent redirects unless specified
Browse files Browse the repository at this point in the history
  • Loading branch information
hnsr committed Sep 20, 2024
1 parent 28b2c0c commit 09ea27e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/magento-store/utils/redirectOrNotFound.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@ export async function redirectOrNotFound(
? routeData.route.relative_url
: undefined

// There is a URL, so we need to check if it can be found in the database.
const permanent = routeData.route?.redirect_code === 301
// For implicit redirects, always use permanent, otherwise use the given redirect type
const permanent = !routeData.route?.redirect_code || routeData.route?.redirect_code === 301

if (
isTypename(routeData.route, [
Expand Down

0 comments on commit 09ea27e

Please sign in to comment.