Ultra Web Hosting Docs

Redirects

Redirects automatically forward visitors from one URL to another. Use them when you move pages, change domain names, or restructure your website.

Types of Redirects

cPanel supports two types of HTTP redirects:

Tip When in doubt, use a 301 redirect. Most redirects are permanent, and a 301 ensures search engines update their index to reflect the new URL.

Creating a Redirect

  1. Log into cPanel.
  2. In the Domains section, click Redirects.
  3. Select the redirect type: Permanent (301) or Temporary (302).
  4. Choose the domain from the dropdown. To redirect a specific page, enter the path in the field next to the domain (e.g., /old-page).
  5. Enter the full destination URL, including https:// (e.g., https://yourdomain.com/new-page).
  6. Choose your redirect settings:
    • Only redirect with www. — Only redirects the www.yourdomain.com version.
    • Redirect with or without www. — Redirects both yourdomain.com and www.yourdomain.com.
    • Do Not Redirect www. — Only redirects the non-www version.
  7. Optionally check Wild Card Redirect to redirect all pages under the specified path to the same path on the new domain.
  8. Click Add.

Common Redirect Examples

Redirect an Entire Domain

To redirect all traffic from olddomain.com to newdomain.com:

Redirect a Single Page

To redirect yourdomain.com/old-page to yourdomain.com/new-page:

Redirect HTTP to HTTPS

If you have an SSL certificate installed and want to force all traffic to use HTTPS, the easiest method is to add the following to your .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Note If your site uses WordPress, many security plugins can handle HTTP-to-HTTPS redirects for you. You can also enable Force HTTPS Redirect from the Domains section in cPanel.

Managing Existing Redirects

At the bottom of the Redirects page, you will see a table listing all current redirects. From here you can:

Redirects via .htaccess

For more complex redirect rules, you can edit your .htaccess file directly. This gives you full control using Apache's mod_rewrite module. Some examples:

Redirect with a Query String

RewriteEngine On
RewriteCond %{QUERY_STRING} ^id=5$
RewriteRule ^page\.php$ /new-page? [R=301,L]

Redirect an Entire Directory

RewriteEngine On
RewriteRule ^old-directory/(.*)$ /new-directory/$1 [R=301,L]
Warning Be careful when editing .htaccess. A syntax error can make your entire website inaccessible. Always keep a backup of the original file before making changes. If your site goes down, rename or delete the .htaccess file via File Manager to restore access.