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.

How to point Parked domain to Main domain

Discussion in 'cPanel Developers' started by gopal, Mar 31, 2004.

  1. gopal

    gopal Guest

    For Example I want point may Parked domain "aa.com" to my main domain "aa.ca". By default both are pointing to same location but when I accessing the aa.com in the browser it should redirect to "aa.ca" for this I have created a Sub domain in the name of "aa" and set the addon domain "aa.com", and I have created the .htaccess file inside the sub-folder and added the line like,

    .htaccess file :-

    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^aa.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.aa.com$
    RewriteRule ^(.*)$ http://aa.ca [R=301,L]

    it works fine

    aa.com --> public_html/aa --->aa.ca
     
  2. kiduboy

    kiduboy Member

    Joined:
    Feb 14, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
  3. kiduboy

    kiduboy Member

    Joined:
    Feb 14, 2004
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    India
    Okay!!! Seems like I found it. My problem was a bit different.
    all url should redirect to www. ie., domainname.com should automatically point to www.domainname.com. The .htaccess code for this is given below.

    <code>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www..* [NC]
    RewriteRule ^(.*) http://www.%{HTTP_HOST}$1 [R=301]
    </code>

    But this creates problem with frontpage and the workaround that I found is to insert the code inside the virtualhost entry of the domain instead of the .htaccess. Beware!!! take a backup of your httpd.conf before doing it. :D

    Regards,
    Kidz
     
Loading...
Similar Threads - point Parked domain
  1. Killy123
    Replies:
    5
    Views:
    120

Share This Page