> ## Documentation Index
> Fetch the complete documentation index at: https://docs.hiveku.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Manage URL Redirects

> Set up URL redirects for migrated pages, renamed paths, or external destinations

When you rename a page, migrate from an old site, or want to forward a path to somewhere else, redirects keep links working and preserve your SEO.

<CardGroup cols={3}>
  <Card title="Manual" icon="plus">
    Add one at a time
  </Card>

  <Card title="Bulk import" icon="file-csv">
    Upload a CSV
  </Card>

  <Card title="Conversational" icon="wand-magic-sparkles">
    Ask the AI
  </Card>
</CardGroup>

All three paths live at:

```
Project > Hosting > Redirects
```

## Why Redirects Matter

* **Preserve SEO**: a 301 tells Google the page moved permanently — ranking signals transfer
* **Migrations**: old URLs from a previous site keep working after launch
* **Short links**: forward `/demo` to a booking page
* **Renamed paths**: `/old-blog/*` can funnel into `/articles/*` without broken bookmarks

## Option 1: Add Manually

<Steps>
  <Step title="Click Add Redirect">
    On the Redirects page, click **+ Add Redirect**.
  </Step>

  <Step title="Fill in From Path">
    The path visitors are coming from. Examples:

    * `/old-page`
    * `/blog/2020-launch`
    * `/about-us`
  </Step>

  <Step title="Fill in To Path">
    Where they should end up. Can be a path on your site or a full external URL:

    * `/new-page`
    * `/about`
    * `https://docs.example.com/getting-started`
  </Step>

  <Step title="Pick a Status Code">
    * **301** — permanent move. Search engines transfer SEO value. Use this by default.
    * **302** — temporary. Use when the new URL might revert later (A/B tests, maintenance).
  </Step>

  <Step title="Pick a Match Type">
    * **Exact** — path matches precisely (`/old-page` matches only `/old-page`)
    * **Prefix** — matches everything starting with the pattern (`/blog/*` matches `/blog/anything`)
    * **Regex** — advanced pattern matching (use sparingly)
  </Step>

  <Step title="Toggle Active, add Notes, save">
    You can disable a redirect without deleting it. Notes are optional but helpful when someone else revisits the list later.
  </Step>
</Steps>

## Option 2: Bulk CSV Import

Useful for site migrations — export the old site's URLs and their new homes into a spreadsheet.

<Steps>
  <Step title="Prepare your CSV">
    Columns: `from_path`, `to_path`, `status_code`, `match_type`.

    ```csv theme={null}
    from_path,to_path,status_code,match_type
    /old-about,/about,301,exact
    /blog/*,/articles/*,301,prefix
    /team,/company/team,301,exact
    /demo,https://cal.com/acme/demo,302,exact
    ```
  </Step>

  <Step title="Upload">
    Click **Import CSV** on the Redirects page and pick your file. Hiveku validates each row and shows any errors inline before importing.
  </Step>

  <Step title="Review and confirm">
    You'll see a preview of added redirects. Click **Import** to commit.
  </Step>
</Steps>

## Option 3: Ask the AI

From the AI chat:

```
Add a 301 redirect from /old-blog to /blog
```

```
Import these redirects:
/old-about -> /about
/team -> /company/team
/demo -> https://cal.com/acme/demo
```

The AI validates paths and adds them in bulk.

## Deploy Required

<Warning>
  Redirects don't go live until you deploy. A **Pending Redirects** counter at the top of the page shows how many changes are waiting. Click **Deploy** to push them.
</Warning>

## Blocked Characters

For security, these characters aren't allowed in paths: quotes (`"`, `'`), backticks, pipes (`|`), `$`, `{`, `}`, `[`, `]`. If you need a path with special characters, URL-encode them first.

## Performance and Limits

Up to **150 active redirects** are handled at the CDN edge for instant response. Beyond that limit, Hiveku uses an alternate mechanism that still works, just with minor added latency (a few ms). If you're importing thousands, consider consolidating with prefix matches where possible.

## 404 Handling

At the bottom of the Redirects page you can pick how unmatched URLs behave:

* **SPA mode** — serve `/index.html` for unmatched paths. Correct for React, Vue, or any client-side routed single-page app.
* **Static mode** — serve a custom `404.html`. Correct for static sites with server-rendered pages.

Pick SPA mode if your client-side routes are breaking on refresh. Pick Static mode if you have a real multi-page site and want a proper 404.

## Verifying a Redirect

<Steps>
  <Step title="Deploy first">
    Make sure the Pending counter is zero.
  </Step>

  <Step title="Open the old URL in a new tab">
    Use an incognito window to bypass browser cache.
  </Step>

  <Step title="Check the Network tab">
    Open browser dev tools (F12) > Network. The old URL should show a **301** or **302** response, with a **Location** header pointing at the new URL.
  </Step>

  <Step title="Confirm the final destination">
    You should land on the new URL.
  </Step>
</Steps>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Redirect isn't firing">
    Did you deploy? The **Pending Redirects** counter at the top of the page shows uncommitted changes. Click **Deploy** to push them live.
  </Accordion>

  <Accordion title="Prefix match is catching too much">
    A prefix rule like `/blog/*` matches `/blog`, `/blog/post-1`, `/blog/anything`. If you want only direct children and not the root, use two rules — exact for `/blog` and prefix for `/blog/`.
  </Accordion>

  <Accordion title="Redirect loop (browser shows 'too many redirects')">
    The **to\_path** matches a pattern that the **from\_path** also matches. For example, a prefix rule `/old/*` -> `/old-new/*` where `/old-new` itself still matches the original rule. Test your patterns against concrete example URLs.
  </Accordion>

  <Accordion title="Status code is wrong for SEO">
    Use 301 for permanent moves — this is what transfers link equity. 302 tells search engines the move is temporary and ranking stays with the old URL. When in doubt, use 301.
  </Accordion>

  <Accordion title="CSV import rejected rows">
    Common issues: blocked characters in paths, invalid status codes (must be 301 or 302), match\_type misspelled (must be `exact`, `prefix`, or `regex`), or duplicate `from_path` values (one rule per source path).
  </Accordion>
</AccordionGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="Custom Domain" icon="globe" href="/how-tos/custom-domain">
    Point your domain at the site
  </Card>

  <Card title="Site Enhancements" icon="sparkles" href="/how-tos/site-enhancements">
    Enable SEO, security headers, and more with one click
  </Card>
</CardGroup>
