← back to Silverleafwallpaper
301 redirect legacy /(about|care|history|sourcing|trade).html + /index.html -> clean URLs (before express.static; static served both forms = duplicate content, nav already clean)
86624214ef7c06b7ad130641be20a5378642d9a4 · 2026-06-01 07:50:30 -0700 · Steve Abrams
Files touched
Diff
commit 86624214ef7c06b7ad130641be20a5378642d9a4
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Jun 1 07:50:30 2026 -0700
301 redirect legacy /(about|care|history|sourcing|trade).html + /index.html -> clean URLs (before express.static; static served both forms = duplicate content, nav already clean)
---
server.js | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/server.js b/server.js
index 508a2ac..dc1993e 100644
--- a/server.js
+++ b/server.js
@@ -149,6 +149,15 @@ catch (e) { console.warn(`[${__SITE}] api-vendor-redact unavailable (${e.message
require('./_universal-contact')(app, { siteName: "Silverleaf Wallpaper", zdColor: "#c0c0c8", zdPosition: 'right' });
require('./_universal-auth')(app, { siteName: "silverleafwallpaper" });
+// Canonical clean URLs — 301 legacy /<page>.html (and /index.html) to the
+// extension-less form so the static dir doesn't serve duplicate content. The
+// nav links already point at the clean URLs; express.static(extensions:['html'])
+// resolves /care -> care.html. MUST run before express.static.
+app.get(/^\/(about|care|history|sourcing|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'), { extensions: ['html'] }));
app.get('/api/products', (req, res) => {
← ce901ac feat(fleet): theme1/theme2 query-param-gated toggle on catal
·
back to Silverleafwallpaper
·
Remove Big Red widget — never UX-worked, collided with Help 7797c48 →