Skip to content

Conversation

@matteotrubini
Copy link
Contributor

Introduces a redirectStatus config option to set the HTTP status code for redirects managed by the plugin. Redirects now use the value from config instead of the default 302, allowing for more flexible redirect behavior.

Introduces a `redirectStatus` config option to set the HTTP status code for redirects managed by the plugin. Redirects now use the value from config instead of the default 302, allowing for more flexible redirect behavior.
@mjauvin mjauvin self-assigned this Jul 21, 2025
@mjauvin mjauvin added this to the v2.3.1 milestone Jul 21, 2025
@mjauvin mjauvin merged commit 24c82e4 into wintercms:main Jul 21, 2025
4 checks passed
@mjauvin
Copy link
Member

mjauvin commented Jul 21, 2025

Thanks @matteotrubini, nice addition!

|
*/

'redirectStatus' => env('TRANSLATE_REDIRECT_STATUS', 302),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thoughts on having this be a property of the component instead of a config item?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically, I believe this is a general configuration applicable to all possible redirects managed by the plugin, even if at the moment they exist only in one component. It can also be used by plugin extensions, for example.
Anyway, I think it could be a good idea to provide an optional property with default value coming from the configuration to allow maximum flexibility.
In that case, prefixDefaultLocale should be configured in the same way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants