Testing redirect rules on a deploy preview

Hi,

Our company blog (built in nextjs) is deployed tothe site: productblog-uat-prod. We are migrating the blog to a subdirectory of our main website, which is in a different github project (also deployed in netlify).

I need to setup a redirect rule so requests to current domain 301 to the new domain. I think I understand the syntax using netlify.toml however the redirects are not working in my deploy preview.

Here are my test redirects:

[[redirects]]

from = “/index.html”
to = “https://example.com/blog
status = 301
force = false

[[redirects]]
from = “/”
to = “https://example.com/blog
status = 301
force = false

[[redirects]]
from = “/blog/*”
to = “https://example.com/blog/:splat
status = 301
force = false

Have I got the rules wrong, or is it just not possible to test redirect rules in a deploy preview? And if not, how can I test them?

Note also that I’m not sure whether I need both homepage redirects - testing it will help me confirm.

Thanks

Try the same rules with a 200 status and force true. I’m not very sure, but maybe it will work.

1 Like

Hi thanks for this. I needed the 301 as it’s a permanent site move, but the force true did it!