Hi! I’d like to setup netlify in a way that, when a param is present, it should take me to the preview server.
Like this:
GET /home
Will take me to the normal homepage
but
GET /home?preview=true
will take me to https://www.test.com/home
I tried with this rule
/* preview=true https://www.test.com/:splat 200
And it kinda works.
If I visit any non-existing page, it does the redirection correctly and as expected.
But if the route matches a page that actually exists, it won’t redirect, just show the file.
Here are the examples:
https://distracted-jepsen-ca33fe.netlify.com/hello
Will show 404, because the page doesn’t exist.
https://distracted-jepsen-ca33fe.netlify.com/hello?preview=true
will successfully take me to www.test.com/hello
https://distracted-jepsen-ca33fe.netlify.com/test
naturally takes me to an existing page as expected
But here’s my problem:
https://distracted-jepsen-ca33fe.netlify.com/test?preview=true
Still takes me to the existing page, doesn’t do the redirect.
What am I doing wrong?