fix(seo): remove duplicate /topic/work/ and /topic/kids/ slugs; add 301 redirects to canonical long-tail URLs

This commit is contained in:
djg 2026-10-01 21:52:51 +00:00
parent c0aa0bf273
commit 3249f4ea29
2 changed files with 7 additions and 6 deletions

View file

@ -76,12 +76,6 @@ TOPICS = [
{"slug": "vacation", "name": "Dad Jokes About Vacation", "emoji": "🏖️",
"intro": "Time to pack your bags and your best puns! These dad jokes about vacation will have you laughing all the way to your destination.",
"keywords": r"\b(vacation|trip|travel|holiday|packing)\b"},
{"slug": "work", "name": "Dad Jokes About Work", "emoji": "🏢",
"intro": "Don't work too hard... unless it's working on your punchlines. These dad jokes about work are perfect for the water cooler.",
"keywords": r"\b(work|office|job|boss|meeting)\b"},
{"slug": "kids", "name": "Dad Jokes About Kids", "emoji": "👶",
"intro": "They grow up so fast, but these jokes never get old. Here are the best dad jokes about kids.",
"keywords": r"\b(kid|child|children|son|daughter)\b"},
{"slug": "food", "name": "Dad Jokes About Food", "emoji": "🍔",
"intro": "Hungry for a laugh? These dad jokes about food will hit the spot.",
"keywords": r"\b(food|eat|dinner|lunch|breakfast|hungry|pizza|coffee|cheese|lettuce)\b"},

View file

@ -30,6 +30,13 @@ http {
add_header Permissions-Policy "geolocation=(), microphone=(), camera=()" always;
add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
}
# Redirect old short topic slugs to long-tail canonical URLs
location = /topic/work/ {
return 301 /topic/work-dad-jokes/;
}
location = /topic/kids/ {
return 301 /topic/dad-jokes-for-kids/;
}
location / {
try_files $uri $uri/ $uri/index.html =404;
}