Skip to content

Use 301 for default-locale redirects#16396

Merged
wackerow merged 1 commit into
devfrom
default-locale-redirect
Oct 1, 2025
Merged

Use 301 for default-locale redirects#16396
wackerow merged 1 commit into
devfrom
default-locale-redirect

Conversation

@pettinarip
Copy link
Copy Markdown
Member

Description

Converts 307→301 when pathname starts with /${DEFAULT_LOCALE}.

@netlify
Copy link
Copy Markdown

netlify Bot commented Sep 30, 2025

Deploy Preview for ethereumorg ready!

Name Link
🔨 Latest commit 7072e0f
🔍 Latest deploy log https://app.netlify.com/projects/ethereumorg/deploys/68db965de1d81d0008106b3d
😎 Deploy Preview https://deploy-preview-16396--ethereumorg.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
7 paths audited
Performance: 43 (🔴 down 12 from production)
Accessibility: 94 (no change from production)
Best Practices: 92 (🔴 down 8 from production)
SEO: 92 (no change from production)
PWA: 59 (no change from production)
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

@wackerow
Copy link
Copy Markdown
Member

image

/en or /en/ -> / showing 301 (Moved Permanently) for me

image

/es -redirects-to-> /es/ and shows as 308 (Permanent Redirect)

This (308) passes the SEO ranking along, so I think this is fine (ref: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/308)

@pettinarip pettinarip marked this pull request as ready for review October 1, 2025 10:07
Copy link
Copy Markdown
Member

@wackerow wackerow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, thanks @pettinarip

@wackerow wackerow merged commit 9c3138b into dev Oct 1, 2025
7 checks passed
@wackerow wackerow deleted the default-locale-redirect branch October 1, 2025 19:23
This was referenced Oct 9, 2025
Comment thread middleware.ts
import { DEFAULT_LOCALE } from "./src/lib/constants"

export default createMiddleware(routing)
const handleI18nRouting = createMiddleware(routing)
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// Example middleware for logging requests
function requestLogger(req, res, next) {
console.log(${req.method} ${req.url});
next(); // Call the next middleware
}

This was referenced Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants