Author Topic: How to use 2 domains on one account?  (Read 2108 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
How to use 2 domains on one account?
« on: December 09, 2022, 10:40:25 PM »
I have added a second domain in the cwp user cp and set the dir to go to the main domain. But when I type in domain2.com it changes to domain1.com and I want it to stay domain2.com throughout the site. How can this be done?

Offline
***
Re: How to use 2 domains on one account?
« Reply #1 on: December 10, 2022, 05:23:38 PM »
use addon domain
then add second domain and point it to other directory not public_html

Offline
*
Re: How to use 2 domains on one account?
« Reply #2 on: May 21, 2023, 06:25:36 AM »
use addon domain
then add second domain and point it to other directory not public_html

I have been trying to do this but when I go into the little folder and point it to somewhere else besides the public_html of the folder I need it to go to it doesn't go to that site it errors not found.

Example: I have www.example.com and I want www.anotherdomain.com to go to www.example.com and not change to www.example.com but stay www.anotherdomain.com and show the same website. Basically 2 domains showing the same website.

Offline
*****
Re: How to use 2 domains on one account?
« Reply #3 on: May 21, 2023, 08:11:32 AM »
You can certainly add another add on domain pointing to the same public_html directory. I do that on all my CWP servers. The add-on domains load the same site content as the main domain (in my case, WordPress installs).

Offline
**
Re: How to use 2 domains on one account?
« Reply #4 on: May 21, 2023, 10:52:57 AM »
If both domains www.example.com www.anotherdomain.com are pointed to the same folder but the domain name is changed in the address bar to www.example.com when you open www.anotherdomain.com then it could be caused by:

1. mod_rewrite redirects stored in .htaccess located in the home folder (document root) of the website
2. CMS used by you for your website www.example.com. It is common case for the websites built on Wordpress, Joomla, etc.

To investiate:

1. Create a test file (test.php):

Code: [Select]
<?php
echo "Hello World !";
?>

and place it in the home folder (document root) of the website www.example.com.

2. Try to open the file test.php through the second domain name e.g:
http://www.anotherdomain.com/test.php

If the URL is changed to:
http://www.example.com/test.php
in the address bar of your browser then the problem is cased by the mod_rewrite rules stored in .htaccess

If the URL remains unchanged then the redirect from http://www.anotherdomain.com/test.php to http://www.example.com caused by the CMS your website is based on.