Author Topic: How To Parked Domains - multi domains to one domain  (Read 10131 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How To Parked Domains - multi domains to one domain
« on: May 01, 2015, 02:55:05 PM »
Picked this little trick up while looking to redirect some domains. You could do this in the htaccess file but if like me that doesn't work <long story> you might need this because CWP does not currently do parked domains.

For a site that has changed it's domain or has multi domains pointed to it.Lets say your main domain is MYDOMAIN.COM but you used to use one called MYOLDDOMAIN.COM. You don't want to loose the visitors who still go to the old domain name and you still own it or the domain is just another version eg. mydomain.com, mydomain.co.uk, mydomain.eu etc etc

Edit the vhosts file found under Apache Settings. Look for the Host section of MYOLDDOMAIN.COM and add in the line RedirectPermanent / http://newdomain.com/

EXAMPLE

# vhost_start olddomain.com
<VirtualHost ***.***.89.41:80>
ServerName olddomain.com
ServerAlias www.olddomain.com
RedirectPermanent / http://newdomain.com/

Offline
*
Re: How To Parked Domains - multi domains to one domain
« Reply #1 on: February 08, 2019, 11:44:39 AM »
The reported method doesn't work because it's overwritten as soon as the vhost files are rebuilt. There is a good solution that is not overwritten by the system, that is:
- First create an additional domain and give it a path in the directory of your account es: /home/myaccount/domainadd/ and not the default path (/home/myaccount/public_html). Create in the directory you just created a .htacess file with the following line:
RedirectPermanent / http://newdomain.com/ or
RedirectPermanent / https://newdomain.com/ if you want redirect all trafic in ssl mode.
It works great