Back to Shared Hosting Documentation

    URL Redirects

    Redirect visitors from old URLs to new destinations for better SEO and user experience.

    What are URL Redirects?

    URL redirects automatically send visitors from one URL to another. This is useful when you've moved content, changed domain names, or want to create user-friendly URLs.

    Types of Redirects

    301 Redirect (Permanent)Recommended

    • • Tells search engines the page has moved permanently
    • • Transfers SEO value (link juice) to the new URL
    • • Use when content has permanently moved

    302 Redirect (Temporary)

    • • Indicates the move is temporary
    • • Doesn't transfer SEO value
    • • Use for A/B testing or temporary moves

    Creating Redirects in cPanel

    1

    Access Redirects

    1. Log in to your cPanel account
    2. Navigate to the "Domains" section
    3. Click on "Redirects"
    2

    Configure Redirect

    Type: Select "Permanent (301)" or "Temporary (302)"

    Domain: Choose the domain for the old URL

    Path: Enter the path to redirect from (e.g., /old-page.html)

    Redirects to: Enter the full destination URL

    www. redirection: Choose how to handle www

    Wild Card Redirect: Enable to redirect all files in the directory

    3

    Add Redirect

    Review your settings and click "Add". The redirect is now active.

    Common Redirect Examples

    Single Page Redirect

    Type: Permanent (301)

    From: yourdomain.com/old-about.html

    To: https://yourdomain.com/about

    Wild Card: Off

    Directory Redirect

    Type: Permanent (301)

    From: yourdomain.com/blog/

    To: https://newdomain.com/blog/

    Wild Card: On (redirects all files in /blog/)

    Domain Change

    Type: Permanent (301)

    From: olddomain.com/

    To: https://newdomain.com/

    Wild Card: On (redirects entire site)

    Manual .htaccess Redirects

    For more control, you can add redirects directly to your .htaccess file:

    Simple 301 Redirect

    Redirect 301 /old-page.html https://yourdomain.com/new-page.html

    Multiple Redirects

    Redirect 301 /old-page.html https://yourdomain.com/new-page.html
    Redirect 301 /about-us.html https://yourdomain.com/about
    Redirect 301 /contact.htm https://yourdomain.com/contact

    Redirect Entire Domain

    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^olddomain\.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.olddomain\.com$
    RewriteRule ^(.*)$ https://newdomain.com/$1 [R=301,L]

    Force HTTPS

    RewriteEngine On
    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

    Force www (or non-www)

    # Force www
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain\.com [NC]
    RewriteRule ^(.*)$ https://www.yourdomain.com/$1 [L,R=301]
    
    # Force non-www
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^www\.yourdomain\.com [NC]
    RewriteRule ^(.*)$ https://yourdomain.com/$1 [L,R=301]

    SEO Best Practices

    • Use 301 for permanent changes: Preserves SEO rankings
    • Avoid redirect chains: Redirect directly to final destination
    • Update internal links: Don't rely solely on redirects
    • Keep redirects active: Maintain for at least 1 year
    • Update sitemap: Submit new URLs to search engines
    • Monitor 404 errors: Set up redirects for frequently requested missing pages

    Testing Redirects

    Browser Test

    1. Enter the old URL in your browser
    2. Check if you're automatically redirected
    3. Verify the destination URL is correct

    Header Checker Tool

    1. Use an online HTTP header checker
    2. Enter your old URL
    3. Verify the response code (301 or 302)
    4. Check the "Location" header shows correct destination

    Command Line Test

    curl -I https://yourdomain.com/old-page.html

    Common Issues

    • Redirect Loops: Check you're not redirecting a page to itself
    • Not Working: Clear browser cache and test in incognito mode
    • Wrong Destination: Double-check the destination URL is complete
    • Case Sensitivity: Linux servers are case-sensitive with file paths
    • Conflicting Rules: Check .htaccess for conflicting redirect rules