WWW. Subdomain redirect for all alias. ¿Its possible?

Hello,

Now in my panel I have one domain added with a lot of alias (more tan 100 domains).
This alias are not subdomain for primary, are other custom domains.

Example:
Primary domain: superdomain.com
Alias for superdomain.com: alias1.com, alias2.com, alias3.com, alias4.com

All the alias domain have this DNS configuration in registry to view the same text as primary domain:

A RECORDS:
alias1.com”,900,“A”,“IP to my primary domain”
www.alias1.com”,900,“A”,“IP to my primary domain”"

Whit this configuration when go in navigator to “http://alias1.com” all is ok and I view the html text I have in my primary domain.

But if go to “http://www.alias1.com” , I only view the default hestia template with text: " Success! Your new web server is ready to use.

To working welll all the subdomain WWW in alias domain and redirect correctly to NON-WWW I need to add in the alias list all the same domains with www.

Example:
Primary domain: superdomain.com
Alias for superdomain.com: alias1.com, www.alias1.com, alias2.com, www.alias2.com, alias3.com www.alias3.com

There is some possibility of working with no need duplicate alias list with www.?

To get www.alias.com working you need to add the alias aswell…

2 Likes

To make things faster you may create a bash script to assist you

1 Like

ahhh… was a pitty.
I think that maybe possible have “other option” to not to add the www. subdomains for all domains in the alias list

Because in this case if I have 500 alias domains need to duplicate this alias with www subdomains and then for full control if I get too heavy.
Maybe with htaccess. archive or or something else…

About to create a bash script to automate, I lear about it if no have any other possibilities.

Many thanks guys!

If it needs to be redict to domain.com and you accept it without working ssl:

Add in /etc/nginx/conf.d/ip.conf a line that sends all traffic to domain.com

1 Like

Hi eris,

Working with universal SSL for the alias via cloudflare.
In alias domain registry put the nameserves to go cloudflare.

In cloudflare add A RECORDS:
alias1.com”,900,“A”,“IP to my primary domain”
www.alias1.com”,900,“A”,“IP to my primary domain”"

In my case in the alias domain view the same content have in the primary domain but… No change the domain in navbar, this is very important for me. Same contect but all in different domains.

You need to rewrite it to your main domain on your own.

1 Like

Hi scIT,

Not understand very well your tip.
Speak about eris last option?

Won’t work…

As nginx doesn’t reconize the virtual host on default and Hestia is not designed to host a website on /var/www/

1 Like

Thanks for reply eris,
To resume, only have the option to add all the www. subdomains to alias list, right?
Via manual or with script.

One idea…
Now if go to “www.alias1.com” , I only view the default hestia template with text: " Success! Your new web server is ready to use.

mmm…
Maybe possible change this template to redirect and send all www. subdomains trafic to view the same text as primary domain ?
Maybe with HTML redirect add in the default hestia template in the head section?

<meta http-equiv="refresh" content="0; url=http://example.com/" />

Or with script in the HMTL, similar to

<script>document.location = "someURL"</script>

But you will also do it with a script and you would have to create al the www domains

Why not just wildcard it in the Nginx and Apache vhost config so that any call to 80/443 is served by your server?
SSL will be handled by Cloudflare.
Just a guess :slight_smile:

Mehargags any manual for view this, how is working and how to put wildcard in Nginx and Apache vhost?
I am very amateur with admins server and all go with “try and failure” :sweat_smile:

or use CNAME for www. in the DNS?