[object Object]

← back to 1970swallpaper

Add .html→clean-URL 301 redirects (care/history/sourcing/trade)

67f0d0609308bb4d03708809119446aee9e7e63f · 2026-06-01 07:16:27 -0700 · SteveStudio2

Files touched

Diff

commit 67f0d0609308bb4d03708809119446aee9e7e63f
Author: SteveStudio2 <steve@designerwallcoverings.com>
Date:   Mon Jun 1 07:16:27 2026 -0700

    Add .html→clean-URL 301 redirects (care/history/sourcing/trade)
---
 server.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server.js b/server.js
index 3bcc150..99f40d2 100644
--- a/server.js
+++ b/server.js
@@ -155,6 +155,12 @@ app.use((req, res, next) => {
   next();
 });
 
+// Old .html form → canonical clean URL (301). Must precede express.static,
+// which would otherwise serve the .html file directly.
+for (const slug of ['care', 'history', 'sourcing', 'trade']) {
+  app.get('/' + slug + '.html', (req, res) => res.redirect(301, '/' + slug));
+}
+
 app.use(express.static(path.join(__dirname, 'public')));
 
 // Clean-URL routes for extension-less nav links → existing static pages.

← 62de93b fix: remove public backup file leak + harden 404-guard to bl  ·  back to 1970swallpaper  ·  Remove Big Red widget — never UX-worked, collided with Help aac0b01 →