p5.js-website icon indicating copy to clipboard operation
p5.js-website copied to clipboard

Fix: Remove trailing slashes from external URLs to prevent 404 errors

Open hxrshxz opened this issue 2 months ago • 1 comments

Fixes #878

Description

Wikipedia and other external links were breaking with 404 errors due to Astro's trailingSlash: "always" config which was appending slashes to all URLs.

Changes

  • Modified middleware to remove traling slashes from external URLs (except root domains like https://example.com/)
  • Make sure that the middleware runs for all locales, including the default English local

https://github.com/user-attachments/assets/bd37cdca-5fc3-4ff1-bc06-85b53774ec06

hxrshxz avatar Oct 11 '25 17:10 hxrshxz