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.

Canonical Parked Addon Domains Sub Domains .htaccess

Discussion in 'General Discussion' started by richardmorris, Jul 15, 2013.

  1. richardmorris

    richardmorris Registered

    Joined:
    Jul 13, 2013
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Website Owner
    I want to make all of my parked and addon domains and sub domains canonical for better SEO on Google using the .htaccess file.

    I used the following lines but it only works for my parked domains and sub domains but not for my addon domains and sub domains, see below:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    Results:

    Add on domains and sub domains failure:

    addondomain.com permanently redirects to www.addondomain.com/addondomain.com/ Failure

    admin.addondomain.com permanently redirects to www.admin.addondomain.com/addondomain.com/admin/ Failure

    Parked domains and sub domains successful:

    parkeddomain.com permanently redirects to www.parkeddomain.com Success

    admin.parkeddomain.com permanently redirects to www.admin.parkeddomain.com Success

    Objective:

    One .htaccess file to control the canonical www in all of my parked and addon domains and sub domains.

    But I don’t know the correct lines of code to use in my .htaccess file to make this work?

    Please help.

    Thank you,
    Richard Morris
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    654
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
Loading...

Share This Page