0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-04-07 23:41:43 -05:00

Docs: Clarify redirects use case (#13370)

Those changes give visibility to the fact that the use case to redirect from a folder to a file is not supported.
https://github.com/withastro/astro/issues/12532#issuecomment-2703410890

Co-authored-by: ematipico <602478+ematipico@users.noreply.github.com>
This commit is contained in:
Tobias 2025-03-11 13:19:19 +01:00 committed by GitHub
parent 6b8fdb8a11
commit 615ae29a6f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -264,7 +264,7 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
* When redirects occur in production for GET requests, the redirect will be a 301 (permanent) redirect. For all other request methods, it will be a 308 (permanent, and preserve the request method) redirect.
*
* Trailing slashes on prerendered pages are handled by the hosting platform, and may not respect your chosen configuration.
* See your hosting platform's documentation for more information.
* See your hosting platform's documentation for more information. You cannot use Astro [redirects](#redirects) for this use case at this point.
*
* ```js
* {
@ -297,7 +297,8 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
* '/news': {
* status: 302,
* destination: 'https://example.com/news'
* }
* },
* // '/product1/', '/product1' // Note, this is not supported
* }
* })
* ```
@ -321,6 +322,8 @@ export interface ViteUserConfig extends OriginalViteUserConfig {
* },
* }
* })
*
*
* ```
*/
redirects?: Record<string, RedirectConfig>;