Author Topic: Redirect Domain using CNAME outside of CWP Instance  (Read 6829 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Redirect Domain using CNAME outside of CWP Instance
« on: April 14, 2021, 11:50:09 AM »
Good afternoon all,

I currently have CWP setup with Apache.

I have tried tinkering with the conf.d files (Including the SSL config file), however, I have had no luck.

Essentially, I have a CWP User with domain example.com, with a website setup and working great, no issues.

I want to point another domain, let's say: website.com to example.com using CNAME.

The reason for this is that I have a URL shortening script which allows for custom domains to be linked to the script.

I have tried adjusting/editing the conf.d files for example.com to try and allow website.com (and other domains pointed to example.com). When I point website.com to example.com using CNAME and load website.com in a browser, it shows the "HTTP Test Page" from CWP, and it does NOT show the content on example.com.

I have tried tinkering around, including copying the conf.d configuration as suggested by the developer of the script, however, I feel there is a misconfiguration somewhere with CWP and/or Apache, since it is wanting to handle the domain, website.com, as if it were a new domain pending to be linked to a CWP user account.

The virtual host recommended by the script developer is as it comes below - FYI, I have attempted to configure both conf.d files, including the SSL conf file, to no avail. Not sure where I'm going wrong in this particular instance, or if there are additional files I need to edit in order to allow website.com to CNAME example.com...

(IP Changed for privacy)
Code: [Select]
<VirtualHost 123.123.123.123:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /home/kutitnet/public_html

        <Directory "/home/examplecom/public_html">
            Options Indexes FollowSymLinks
            AllowOverride All
            Require all granted
        </Directory>

CustomLog /usr/local/apache/domlogs/kutit.net.bytes bytes
CustomLog /usr/local/apache/domlogs/kutit.net.log combined
ErrorLog /usr/local/apache/domlogs/kutit.net.error.log

        <IfModule mod_dir.c>
            DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
        </IfModule>

</VirtualHost>

I also did the same for the SSL Config file, adding the required SSL certificates.

Unfortunately, as mentioned, when I visit website.com, it takes me to the HTTP Test Page instead of the content hosted on example.com. I DO NOT want to have to add website.com to the CWP user panel, and I don't want to have to manually add the domain into any config files if I don't have to, as I have clients who I want to be able to point their domains to example.com and allow the script to accept/reject traffic according to how their account is setup on the PHP script hosted on example.com.

To clarify, everything works great when visiting example.com. Somewhere within CWP is preventing website.com from using example.com as a CNAME, and it CWP wants to handle it as if it were an add-on domain.
« Last Edit: April 14, 2021, 11:56:13 AM by LiamTGCS »

Offline
*
Re: Redirect Domain using CNAME outside of CWP Instance
« Reply #1 on: April 17, 2021, 01:26:09 PM »
Have tried a few other work arounds but still can't get website.com to "mask/frame" (using CNAME) example.com.

Whenever I point website.com to example.com, navigating to website.com will take me to the CWP HTTP Test Page as mentioned.

Anyone with any idea on this would be sincerely appreciated as I'm still having troubles despite my attempts at trying to work around this. There's probably something I'm missing other than the vHost's file.


Offline
*
Re: Redirect Domain using CNAME outside of CWP Instance
« Reply #2 on: April 19, 2021, 11:25:56 PM »
@Sandeep
@Igor S.

Any idea on this?

Offline
*
Re: Redirect Domain using CNAME outside of CWP Instance
« Reply #3 on: April 26, 2021, 11:26:17 PM »
Still no luck with this - any help would be appreciated.

Offline
*
Re: Redirect Domain using CNAME outside of CWP Instance
« Reply #4 on: April 29, 2021, 12:33:53 PM »
Any help would be sincerely appreciated. Thanks all.

Offline
*
Re: Redirect Domain using CNAME outside of CWP Instance
« Reply #5 on: May 05, 2021, 11:19:21 PM »
Bump.

Offline
*
Re: Redirect Domain using CNAME outside of CWP Instance
« Reply #6 on: May 06, 2021, 05:37:54 AM »
Hi LiamTGCS, if you want to open all example.com when you access website.com, you can add the same user, from CWP Admin - Domains - Add Domain (folder path / public_html), if both domains want to be on the same server, pay attention to DNS zones