Skip to content

fix: add missing redirects#2333

Merged
bjohansebas merged 3 commits into
expressjs:mainfrom
krzysdz:emergency-add-html-redirects
Jun 21, 2026
Merged

fix: add missing redirects#2333
bjohansebas merged 3 commits into
expressjs:mainfrom
krzysdz:emergency-add-html-redirects

Conversation

@krzysdz

@krzysdz krzysdz commented May 19, 2026

Copy link
Copy Markdown
Contributor

Cherry picked 879c8d8 from #2324

Fixes #2327
Fixes #2328
Fixes #2332
Fixes #2343

@krzysdz krzysdz requested a review from a team as a code owner May 19, 2026 19:50
@netlify

netlify Bot commented May 19, 2026

Copy link
Copy Markdown

Deploy Preview for expressjscom-preview ready!

Name Link
🔨 Latest commit 808751a
🔍 Latest deploy log https://app.netlify.com/projects/expressjscom-preview/deploys/6a384adcaee88f000857e40e
😎 Deploy Preview https://deploy-preview-2333--expressjscom-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 99 (🟢 up 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

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

@jonchurch jonchurch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Lets hold off for a moment on adding code to do the html stripping.

I have put in place cloudflare redirect rules to do the .html stripping to at least fix the immediate issues.

So I want to enumerate the actual issues we are seeing rn, as I see the /blog/posts.html to /en/blog redir and am unaware of the specifics there. The cloudflare stripping I put into place wont do that particular one, as an example. nor the api.html => 5x/api redir.

If we can get an accounting of what redirs we need, lets figure out the best path forward from there.

Comment thread src/config/redirect.js Outdated

const redirects = { ...blog, ...api_v2, ...pages };
const api = localizedPages({
'api.html': '5x/api/',

@jonchurch jonchurch May 19, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks like we are missing this /api.html => [latest]/api redir, good catch

The other Nx/api.html are just the html stripping.

Comment thread src/config/redirect.js Outdated
};

const pages = {
'/changelog/4x.html': 'https://github.com/expressjs/express/releases',

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

we do need this one too. My cloudflare rule has an ignore setup for /en/changelog/4x.html but not for the the form without /en/. I can update it to also let this one pass through.

@krzysdz

krzysdz commented May 19, 2026

Copy link
Copy Markdown
Contributor Author

I have added redirects for all (at least I hope so) .html files that were generated in the old version of the website (full list in the attachment below).

The CF redirects don't handle most resources that were accessible without language prefix. These include:

_site-file-list.txt

@bjohansebas

Copy link
Copy Markdown
Member

Okay, I made the creation of redirects without language dynamic so they automatically redirect to English. We don’t really need /api/ to point to /en/5x/api/; /en/api/ is enough since it points to the latest version. The /blog/posts.html to /en/blog one was an oversight—thanks for adding it. I think there shouldn’t be any more broken routes

@expressjs/docs-captains I’m going to merge it so there are no more broken URLs from this migration that weren’t accounted for. If there are still any broken URLs, please report them

@bjohansebas bjohansebas merged commit 61ef8d1 into expressjs:main Jun 21, 2026
14 of 15 checks passed
@bjohansebas

Copy link
Copy Markdown
Member

@krzysdz thanks!

@krzysdz krzysdz deleted the emergency-add-html-redirects branch June 21, 2026 23:41
Comment thread package.json
"scripts": {
"dev": "astro dev",
"build": "astro build",
"build": "NODE_OPTIONS=--max-old-space-size=4096 astro build",

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This doesn't work on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants