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

# Redirect a page or domain to another address

> Send visitors from an old address to a new one with cPanel Redirects or an .htaccess file.

A redirect sends visitors, and search engines, from one address to another. Use it when you move a page, rename your site, or want a second domain to open your main website. This guide shows you how.

## Choose the type

| Type | Use it when | Search engines |
| - | - | - |
| **Permanent (301)** | The move is for good, such as a renamed page or a new domain | Move the old page's ranking to the new address |
| **Temporary (302)** | The move is short-term, such as during maintenance | Keep the old address in their results |

If you're not sure, use **Permanent (301)**.

## Set up a redirect in cPanel

**1. Open Redirects**

[Log in to cPanel](https://kb.hostcloud.in/cpanel/log-in-to-cpanel.md), type **Redirects** in the **Search Tools** box and open it.

**2. Choose the type**

Choose **Permanent (301)** or **Temporary (302)**.

**3. Choose what to redirect**

Pick the domain from the list. To redirect the whole domain, leave the path box empty. To redirect one page, type its path, such as `old-page`.

**4. Enter the new address**

In **Redirects to**, type the full new address, starting with `https://`.

**5. Add it**

Click **Add**. Test it by opening the old address in a private (incognito) window.

To remove a redirect, find it in the list under the form on the same page and delete it.

> [!NOTE]
>
> Want your site to always open with `https://`? Use **Force HTTPS Redirect** instead. See [Force HTTPS](https://kb.hostcloud.in/ssl/force-https.md). For `www` problems, see [www or non-www not working](https://kb.hostcloud.in/dns/www-or-non-www-not-working.md).

## Redirect with an .htaccess file (advanced)

cPanel saves redirects in a file called `.htaccess` in your website's folder. You can also edit it yourself, which helps when you have many redirects.

**1. Open the file**

In **File Manager**, open `public_html`. Click **Settings** and turn on **Show Hidden Files**. Right-click `.htaccess` and choose **Edit**. If there's no `.htaccess`, create a file with that name.

**2. Take a copy first**

Copy the whole file into a text file on your computer before you change anything.

**3. Add your redirects**

Add one line per page at the top of the file, for example:

```apache theme={null}
Redirect 301 /old-page https://yourdomain.com/new-page
Redirect 301 /old-folder/ https://yourdomain.com/new-folder/
```

**4. Save and test**

Save the file and open the old addresses in a private window.

> [!WARNING]
>
> One typo in `.htaccess` can show a "500 Internal Server Error" on your whole site. If that happens, put back the copy you saved. On WordPress sites, don't change the lines between `# BEGIN WordPress` and `# END WordPress`.

## Moving your whole site to a new domain?

Redirect the old domain to the new one only after the new domain works. Keep the old domain registered and the redirect in place for at least a year, so links and search results keep working. See [Change your website's domain name](https://kb.hostcloud.in/cpanel/change-main-domain.md).

Need to lock a folder instead? See [Password-protect a folder](https://kb.hostcloud.in/cpanel/password-protect-a-folder.md).

Still stuck? [Open a ticket](https://kb.hostcloud.in/support/open-a-ticket.md) with the old address and where it should go.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.