[object Object]

← back to Linenwallpaper

301 redirect legacy /(history|vocabulary|sourcing|care|trade|index).html -> clean URLs before express.static

b3f1755442895ce5f39f043f75e3c4b597c7006c · 2026-06-01 07:34:25 -0700 · Steve

Files touched

Diff

commit b3f1755442895ce5f39f043f75e3c4b597c7006c
Author: Steve <steve@designerwallcoverings.com>
Date:   Mon Jun 1 07:34:25 2026 -0700

    301 redirect legacy /(history|vocabulary|sourcing|care|trade|index).html -> clean URLs before express.static
---
 server.js | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/server.js b/server.js
index d3e8955..85035ae 100644
--- a/server.js
+++ b/server.js
@@ -150,6 +150,10 @@ app.use(express.json({ limit: '256kb' }));
 require('./_universal-contact')(app, { siteName: "linenwallpaper", zdColor: "#a89060", zdPosition: 'right' });
 require('./_universal-auth')(app, { siteName: "linenwallpaper" });
 
+// Canonicalize legacy .html nav URLs -> clean extension-less form (301) before static.
+app.get(/^\/(history|vocabulary|sourcing|care|trade)\.html$/, (req, res) => res.redirect(301, '/' + req.params[0]));
+app.get('/index.html', (req, res) => res.redirect(301, '/'));
+
 app.use(express.static(path.join(__dirname, 'public')));
 
 // Shared filter so /api/products and /api/facets agree on the active result set.

← a31c934 /api/facets drill-down: count each dimension over the active  ·  back to Linenwallpaper  ·  Remove Big Red widget — never UX-worked, collided with Help afad948 →