Skip to content

Instantly share code, notes, and snippets.

@philhawksworth
Last active December 27, 2021 21:49
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save philhawksworth/7b12a0785266f8dcf1960d2df93dfc59 to your computer and use it in GitHub Desktop.
Save philhawksworth/7b12a0785266f8dcf1960d2df93dfc59 to your computer and use it in GitHub Desktop.
Simple example of Netlify _redirects file
# Redirect with a 301
/home / 301
# Redirect with a 302
/my-redirect / 302
# Rewrite a path
/pass-through /index.html 200
# Invisbily proxy to a third party API
/api/* https://api.example.com/:splat 200
# Show a custom 404 for a path
/special-offer /too-late-its-over 404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment