Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Author Permalink Structure for Consistency and SEO on 11ty Site #1748

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

reatlat
Copy link
Contributor

@reatlat reatlat commented Dec 19, 2024

This pull request fixes an issue with the author permalink structure on the 11ty website, caused by differences in case sensitivity between Netlify and Vercel. Netlify handles URLs in a case-tolerant manner, automatically forcing them to lowercase, which ensured that links like

worked seamlessly. However, on Vercel, URLs are case-sensitive, which led to inconsistencies and broken links when author slugs were not uniformly lowercase.

Current https://www.11ty.dev/authors/ page contains all links in lowercase format like this

To resolve this, the author permalink structure has been updated to enforce lowercase formatting using a slug filter. This change ensures all author URLs are consistently lowercase, preventing broken links and ensuring proper routing on Vercel’s deployment environment.

By standardizing URLs, this update enhances both user experience and SEO, ensuring predictable, functional, and clean author page links across the site.

Updated the author permalink structure to use a slug filter, ensuring URLs are consistently formatted and SEO-friendly. This helps prevent potential issues with special characters or spaces in author names.
@Snapstromegon
Copy link
Member

The described issue is correct and IMO this is also the right change, but just to make this sure, I'm looping in @zachleat.

Either way: Thanks @reatlat for bringing this up and also providing a fix.

@reatlat
Copy link
Contributor Author

reatlat commented Dec 19, 2024

Another optimal solution is edit vercel.config to something like

{
  "rewrites": [
    {
      "source": "/:path*",
      "destination": "/:path*",
      "has": [
        {
          "type": "header",
          "key": "x-original-url",
          "value": "/.*[A-Z]+.*/"
        }
      ]
    }
  ],
  "redirects": [
    {
      "source": "/(.*[A-Z].*)",
      "destination": "/$1",
      "statusCode": 301
    }
  ]
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants