feat: add SEO-friendly blog post URL routing (/blog/:slug)
Add 301 redirect from /blog/:slug to /blog-post.html?slug=:slug for cleaner, more SEO-friendly blog post URLs. Enables access via: https://agenticgovernance.digital/blog/tractatus-research-working-paper-v01 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
fe7200c038
commit
2a54b69f4b
1 changed files with 6 additions and 0 deletions
|
|
@ -122,6 +122,12 @@ app.use((req, res, next) => {
|
|||
next();
|
||||
});
|
||||
|
||||
// Blog post URL rewriting: /blog/:slug → /blog-post.html?slug=:slug
|
||||
// This provides cleaner URLs for blog posts (SEO-friendly)
|
||||
app.get('/blog/:slug', (req, res) => {
|
||||
res.redirect(301, `/blog-post.html?slug=${req.params.slug}`);
|
||||
});
|
||||
|
||||
// Static files
|
||||
app.use(express.static('public'));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue