Skip to Content

Redirects

Set up URL redirects for moved pages, legacy URLs, and vanity links. Redirects are managed in project settings.

Adding Redirects

  1. Go to project settings
  2. Navigate to Settings > Redirects
  3. Click Add Redirect
  4. Enter the source path (the URL visitors request)
  5. Enter the destination path (where they are sent)
  6. Select the redirect type (301 or 302)
  7. Save

The source path can be an exact path or a regex pattern, and the destination can be an internal path or an external URL.

Redirect Types

TypeUse Case
301 PermanentThe page has permanently moved. Search engines transfer ranking signals to the new URL
302 TemporaryThe page is temporarily at a different location. Use for maintenance or A/B tests

Pattern Matching

Source paths support both exact matches and regex patterns:

PatternMatches
/aboutOnly the exact path /about
/old-blog/.*/old-blog/ and any path beneath it (zero or more characters)
/articles/.+Any path under /articles/ with at least one character after the slash

Exact matches always take priority. If both /special/page and /special/.* are configured, a request to /special/page follows the exact rule.

Homepage Redirects

The homepage (/) is a valid source path. Use it to redirect the root URL to another page — for example, sending / to /home or /landing while you migrate.

Trailing Slashes

Ycode canonicalizes trailing slashes automatically. A request to /about/ is redirected to /about with a 308 response, so you do not need a redirect entry for each variant.

Use Cases

  • Renamed pages — Redirect old URLs to new ones after restructuring
  • Legacy links — Preserve links from old marketing campaigns or external sites
  • Vanity URLs — Short or memorable paths that redirect to longer destinations
  • Bulk migrations — Use a regex pattern to move an entire URL prefix in a single rule

Tip

Prefer 301 for permanent moves. Use 302 when the move is temporary so search engines keep indexing the original URL.

Tip

Test regex redirects in incognito mode — browsers cache redirects aggressively, which can mask configuration changes during testing.

Last updated on