Control Web Panel

WebPanel => How to => Topic started by: fredo on October 26, 2016, 05:10:58 PM

Title: how to create domain alias
Post 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!

Title: Re: how to create domain alias
Post by: martins.deer on March 16, 2017, 12:26:49 PM
BUMP!
;)
Title: Re: how to create domain alias
Post by: martexx on March 17, 2017, 07:32:52 AM
google for htaccess redirect

Title: Re: how to create domain alias
Post by: gosha on May 31, 2017, 07:57:42 AM
I have the same question. .htaccess redirect is not an answer because the redirect is not an alias.
Title: Re: how to create domain alias
Post by: Netino on December 02, 2017, 07:35:42 PM
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.
Title: Re: how to create domain alias
Post by: Netino on December 02, 2017, 07:53:07 PM
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
Title: Re: how to create domain alias
Post by: Serge on December 12, 2022, 09:54:26 PM
Actually it is more simple to add new domain - https://forum.centos-webpanel.com/installation/set-multi-alias-website/