New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSAPI-Cache and CWP Cage at no extra cost with all CWPpro licences. The LSAPI-Cache plugin is integrated into our WordPress and other script installers, and CWP Cage gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

domain.com to www.domain.com

Started by paky1099, August 10, 2017, 01:23:30 PM

Previous topic - Next topic

paky1099

Hi, I created the domain domain.com in the control panel. If i go to http://domain.com I view the HTTP Server Page but I would to redirect domain.com to www.domain.com.

Can I do it? How do you do it?

Thanks


darkness

Normally when you create domain.com, the CWP automatic creates www.domain.com as an ServerAlias in the Apache, localhost.domain.com, ftp.domain.com, mail.domain.com and www.domain.com as a CNAME in Bind(DNS). So, just try to open www.domain.com in your browser. If it`s not working than let me know and we will figure it out.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

6Sense

I use CloudFlare for DNS and set 301 redirects to preferred domain  :)
6Sense - Web Design, Development & Web Hosting

paky1099

Hi,
the www "version" of the website works correctly but if I write the URL without www I see the HTTP Test Page powered by CWP | CentOS-WebPanel.com.

The DNS zone is managed by OVH, not by CWP (it's an error?).

darkness

Hi,
I`ve never used OVH, but you should change the "DocumentRoot" in OVH for domain.com to point on the same place where www.domain.com is pointing and you should be ok. Try and let me know.
UNIX is a very simple OS, but you have to be a GENIUS to understand it ...

paky1099

Hi, I managed the DNS zone with OVH...I haven't any VPS/Dedicated Server/Hosting with OVH.

I check the /usr/local/apache/conf.d/vhosts.conf and this is the content:

# vhost_start domain.com
<VirtualHost ip:80>
ServerName domain.com
ServerAlias www.domain.com
ServerAdmin 5
DocumentRoot "/home/g123ftp1/public_html"
ScriptAlias /cgi-bin/ "/home/g123ftp1/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/g123ftp1/domain.com/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup g123ftp1 g123ftp1
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup g123ftp1 g123ftp1
        suPHP_ConfigPath /home/g123ftp1
</IfModule>

<Directory "/home/g123ftp1/public_html">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end domain.com

I tried to add "ServerAlias domain.com" but is the same.

What can I do?

P.S. I compared the DNS zone of CWP with the DNS zone of OVH and there are the same records.

lecter23

Hi Paky1099, did you solve this? I have the same problem.

Subdomains, including www, are ok, but domain.com without www shows test page.

Thanks!