Menu

vercel redirects

Last updated

The command lets you manage redirects for a project. Redirects managed at the project level apply to all deployments and environments and take effect immediately after being created and promoted to production.

Redirects can also be defined and managed in source control using . Project-level redirects are updated without a need for a new deployment.

Using the vercel redirects command to list all redirects for the current project.

The command includes several subcommands for managing redirects:

List all redirects for the current project. These redirects apply to all deployments and environments.

Options:

  • : Page number to display
  • : Number of redirects per page (default: 50)
  • : Search for redirects by source or destination
  • : List redirects from the staging version
  • : List redirects from a specific version ID

Examples:

List all versions of redirects for the current project.

View the history of all redirect versions for your project.

Add a new redirect to your project.

Options:

  • : Make the redirect case sensitive
  • : Version name for this redirect (max 256 characters)
  • : Preserve query parameters when redirecting
  • : HTTP status code (301, 302, 307, or 308)
  • : Skip prompts and use default values

Examples:

Upload redirects from a CSV or JSON file.

Options:

  • : Replace all existing redirects
  • : Skip confirmation prompt

Examples:

CSV Format:

JSON Format:

Remove a redirect from your project.

Options:

  • : Skip the confirmation prompt when removing a redirect

Example:

Promote a staged redirects version to production.

Options:

  • : Skip the confirmation prompt when promoting

Example:

Restore a previous redirects version.

Options:

  • : Skip the confirmation prompt when restoring

Example:

The following global options can be passed when using the vercel redirects command:

For more information on global options and their usage, refer to the options section.


Was this helpful?

supported.