Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redirect Recipes

Redirect configuration examples for common web servers, CDNs, and deployment platforms.

The examples cover simple 301 redirects, regex and wildcard routing, geo-based redirects, and query parameter handling.

Quick Start

  1. Find your platform below, pick the recipe you need.
  2. Open the config file, read the comment block at the top (what it does, when to use it, gotchas).
  3. Copy the configuration, replace example.com and the sample paths with your own, and deploy.
  4. Validate before shipping - e.g. nginx -t && systemctl reload nginx for Nginx, or test one URL with curl -I and check the Location header and status code.
curl -sI https://example.com/old-page | grep -iE '^(HTTP|location)'

Nginx

Apache

Cloudflare

Vercel

  • redirects.json - vercel.json redirects array: 301/302/308, splats, params, query, host
  • next.config.js - the same patterns via the Next.js redirects() function, plus a geo middleware snippet

Netlify

  • _redirects - plain-text table: 301/302, splats, placeholders, query, geo/language, host
  • netlify.toml - the same rules as typed [[redirects]] blocks

More platform examples can be added as contributions.

Related

Contributing

Add your own recipe! See CONTRIBUTING.md.

License

CC0

About

Redirect configuration examples for web servers, CDNs, and deployment platforms.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages