Hugo site for frobiovox.com, hosted on AWS S3 behind Cloudflare.
To redirect legacy .html URLs (from the old Jekyll site) to the canonical
trailing-slash URLs generated by Hugo, add a single redirect rule in the
Cloudflare dashboard.
- Log in to the Cloudflare dashboard and select the frobiovox.com zone.
- Go to Rules → Redirect Rules.
- Click Create rule.
- Set the rule name to something like
Legacy .html redirect. - Under If incoming requests match, choose Wildcard pattern and enter:
www.frobiovox.com/*.html - Under Then, set the action to Dynamic redirect with:
- Expression:
concat("https://www.frobiovox.com/", wildcard_replace(http.request.uri.path, "/*.html", "${1}"), "/") - Status code:
301
- Expression:
- Save and deploy the rule.
After the rule is active, a request to:
https://www.frobiovox.com/posts/2013/10/06/support-should-not-be-based-on-marketshare.html
will redirect to:
https://www.frobiovox.com/posts/2013/10/06/support-should-not-be-based-on-marketshare/