Skip to content

Redirects #3311

@matthewp

Description

@matthewp

Needs

  • API reference docs
  • ? - This feature is most useful in SSG, so maybe it should go there? This feature does work in SSR as well, but you can already do redirects in SSR (manually) so it's not adding a new capability, just making one easier.

How it works

You can add a top-level redirects config with keys that are from routes and the values are the to route. For example:

import { defineConfig } from 'astro/config';

export default defineConfig({
  redirects: {
    '/api': '/docs/api'
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    add new contentDocument something that is not in docs. May require testing, confirmation, or affect other pages.merge-on-releaseDon't merge this before the feature is released! (MQ=approved but WAIT for feature release!)minor-releaseFor the next minor release; in the milestone, "merge queue" = approved for merging on release day.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions