Question 8

2021-11-03

How would you set up an http 301 status redirect from /netlify/anything on your site, to https://www.google.com/search?q=anything How about a proxy redirect? Please add that proxy redirect rule to your site.


Setting up a redirect or proxy can be done in the netlify.toml or using a _redirects file in the root of your site on deploy.

Redirect using _redirects:

/netlify/*  https://www.google.com/search?q=:splat  301

Proxy Redirect using _redirects:

/netlify/*  https://www.google.com/search?q=:splat  200!

The above proxy redirect will force whether there is an html page for the path or not.

Try: https://netlify-exercise.alves.dev/netlify/jamstack