#auto redirect no trailing slash path to include trailing slash

3 messages · Page 1 of 1 (latest)

clear marsh
#

Hi, I'm trying to rebuild a full wordpress site to be a headless wp site with astro as the frontend.

The site initially includes ending trailing slash for all pages. I wanted to set this up too on astro.

https://docs.astro.build/en/reference/configuration-reference/#trailingslash
I've followed the docs above and added trailingSlash: 'always' to the config. it is working but I want to have a redirection also if users access the pages without trailing slash.
is it possible to configure within astro?

rain needle
azure flume
#

I had to look this up because I do not have trailingSlash: always in my Astro config but my sites all do what you desire automatically. This is a feature called Pretty URLs from Netlify. Maybe your host has something similar?