gohugoio / hugo

The world’s fastest framework for building websites.
https://gohugo.io
Apache License 2.0
74.63k stars 7.45k forks source link

Capture the "splat" part of the URL and use it in Hugo server redirects. #7713

Open zivbk1 opened 3 years ago

zivbk1 commented 3 years ago

I started on the forum: https://discourse.gohugo.io/t/can-splat-be-used-in-hugo-server-redirects-config/28292 Found out it is not possible to use a 'splat' variable to append the remaining part of the URL in a redirect.

It would be nice to have similar functionality in the server redirect feature as I use for Netlify redirects. https://docs.netlify.com/routing/redirects/redirect-options/#splats

bwklein commented 3 years ago

There was a comment on the Hugo forum which is more about the syntax than the feature, but I thought it would be good to mention it here.

It’s probably better to go away from that and make the proposal about a proper redirect command that is able to redirect (.*) by using $1 like the Apache config has.

bep commented 3 years ago

Also see my comment re the same...