301-redirects instead of the default 302-redirects


Kirby makes for various reasons 302-redirects, even for redirects, that are meant to last permanent. Is there a way to configure 301-redirects instead of the default 302-redirects, without editing the source code?

Where is this happening? You can pass the HTTP code to function like go or redirect as parameters.

As @texnixe said, Kirby functions that redirect the user can often take an HTTP code as a parameter. So, if you’re ‘manually’ redirecting people through your code, that may be enough.

If you’re going to be redirecting A LOT of requests - e.g., if you’re rebuilding an old site, and you don’t want to loose the SEO rankings of the old site’s pages - then you could have a look at the awesome Retour Plugin - it can save you a lot of time.

Yes, that plugin is certainly great for monitoring errors and doing redirects on the fly. However, I would always recommend doing known redirects on the server level, not with PHP.