Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

301 Redirect for SEO

Discussion in 'General Discussion' started by mickalo, May 5, 2011.

  1. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    778
    Likes Received:
    4
    Trophy Points:
    318
    Location:
    N.W. Iowa
    Hello,

    I need to setup a 301 redirect for one of our accounts. I'm not very knowledgeable in SEO but I'm thinking it isn't that difficult to setup a redirect, just not sure exactly how this is done.

    What we need to do is when every the domain is called up, it's redirected to www.theirdomain.com instead of theirdomain.com so it always goes to the www.theirdomain.com URL.

    Is there away to do this in the .htaccess file or some configuration in the httpd.conf file ?

    Thanks for any help,

    Mike
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,608
    Likes Received:
    32
    Trophy Points:
    238
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could try something like the following in the public_html directory for the .htaccess file for the domain:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^example.com
    RewriteRule (.*) http://www.example.com/$1 [R=301,L]
    Please replace example.com with the actual domain name for the account.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    778
    Likes Received:
    4
    Trophy Points:
    318
    Location:
    N.W. Iowa
    Thank you. I think that should do the trick. I figured a rewrite rule would be needed but wasn't sure exactly how it's setup.

    Mike
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice