[object Object]

← back to 1930swallpaper

Redirect legacy .html page URLs to canonical clean paths (301)

bdf4480adf6e43bd6737fe935eaadb290d7ff66f · 2026-06-01 07:13:20 -0700 · steve

Files touched

Diff

commit bdf4480adf6e43bd6737fe935eaadb290d7ff66f
Author: steve <steve@designerwallcoverings.com>
Date:   Mon Jun 1 07:13:20 2026 -0700

    Redirect legacy .html page URLs to canonical clean paths (301)
---
 server.js | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/server.js b/server.js
index 44e4275..6ab71eb 100644
--- a/server.js
+++ b/server.js
@@ -156,6 +156,12 @@ app.use((req, res, next) => {
   next();
 });
 
+// Canonical clean URLs: 301 the old .html form to the extension-less path
+// (must run BEFORE express.static, which would otherwise 200 the .html file).
+['history', 'care', 'sourcing', 'trade'].forEach(slug => {
+  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.

← d5553e5 fix: block .bak-* backup leaks from static root + remove sta  ·  back to 1930swallpaper  ·  Remove Big Red widget — never UX-worked, collided with Help 4ceb52e →