Visitar URL original
frob.github.com/hugo at master · frob/frob.github.com · GitHub
Skip to content

Latest commit

 

History

History

hugo

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

frob-hugo

Hugo site for frobiovox.com, hosted on AWS S3 behind Cloudflare.

Cloudflare redirect rule

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.

  1. Log in to the Cloudflare dashboard and select the frobiovox.com zone.
  2. Go to Rules → Redirect Rules.
  3. Click Create rule.
  4. Set the rule name to something like Legacy .html redirect.
  5. Under If incoming requests match, choose Wildcard pattern and enter:
    www.frobiovox.com/*.html
    
  6. 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
  7. 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/