Control Web Panel
WebPanel => How to => Topic started by: fredo on October 26, 2016, 05:10:58 PM
-
Hi,
I´ve been using CWP for a while.. I have a simple question though..
I have a DOMAIN.COM which is the main domain..
And I have DOMAIN.COM.XX which I want to be redirected to DOMAIN.COM.
How can I do that? could someone help me out? should I create a new domain and add .htaccess? or CWP provide a tool manage site redirection? if so, where is it?
Thanks!
-
BUMP!
;)
-
google for htaccess redirect
-
I have the same question. .htaccess redirect is not an answer because the redirect is not an alias.
-
The .htaccess simply is not an answer.
To apache interpret the .htaccess file, the access MUST be arrived at the server, within the path, to interpret this file fontent.
If the access of the alias domain already comes to a directory on the server, the .htaccess should be not needed anymore.
The question is exactly how to make the apache server direct the access of that domain alias to a directory on the server.
-
To make an alias to your domain, you can use the ServerAlias directive of apache server, in the file '/usr/local/apache/conf.d/vhosts.conf'.
If you have, for example:
----------------------------------------------
ServerAlias domainexample.com
----------------------------------------------
you can manually edit to:
--------------------------------------------------------------------------------------
ServerAlias domainexample.com server2.domainexample.com
--------------------------------------------------------------------------------------
or:
------------------------------------------------------------------------------------------------------------------------------
ServerAlias domainexample.com server2.domainexample.com server3.domainexample.com
------------------------------------------------------------------------------------------------------------------------------
or:
------------------------------------------------------
ServerAlias *.domainexample.com
------------------------------------------------------
etc.
The only question I have is, if editing manually, the changes would be overwritten by changes made via panel, ou updates.
Regards,
Netino
-
Actually it is more simple to add new domain - https://forum.centos-webpanel.com/installation/set-multi-alias-website/