Open atinux opened 1 year ago
I think using 302 (non permanent) might be a better choice for default. It is also default for h3 util. (or 307)
We can think of introducing redirect: { code: 301 } route rule to apply 301 to all redirects by default when set for /**
@pi0 I think the idea is having '<ROUTE> <CODE>'
as shortcute here. No defaults used
Ah, I see! That would be dangerous considering URLs can actually include whitespace (which is valid and needs to be encoded finally). An alternative would be [route, code]
wdyt?
'/get-started': { redirect: ['/get-started/installation', 301] },
I am ok with this too, about the whitespace in URL, it is not a best practice and in that case, CloudFlare and Netlify redirects file should fail as well.
But I guess for TypeScript intellisense it will be better with [route, code]
👍
It would be nice to support:
I believe it could be done here: https://github.com/unjs/nitro/blob/11a241244a166b0733b924d16ce5a32e1be89005/src/options.ts#L419