The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    765
    Likes Received:
    2
    Trophy Points:
    18
    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
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    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.
     
  3. mickalo

    mickalo Well-Known Member

    Joined:
    Apr 16, 2002
    Messages:
    765
    Likes Received:
    2
    Trophy Points:
    18
    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
     
Loading...

Share This Page