How to point Parked domain to Main domain

G

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
 

kiduboy

Member
Feb 14, 2004
6
0
151
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