www redirects to non-www
www redirects to non-www
Hi,
i´m running 0.9.8-22 on a Ubuntu 16.04.5 LTS (64) Server.
My question is the following:
I created a Web-Domain "example.com" with an alias "www.example.com".
When i visit the Website using http://www.example.com the url is rewrited to http://example.com.
How can i change that the url is not rewriting to non-www ? Or did i made a mistake on creating the domain ?
I would be glad about the answer
Nitaro
i´m running 0.9.8-22 on a Ubuntu 16.04.5 LTS (64) Server.
My question is the following:
I created a Web-Domain "example.com" with an alias "www.example.com".
When i visit the Website using http://www.example.com the url is rewrited to http://example.com.
How can i change that the url is not rewriting to non-www ? Or did i made a mistake on creating the domain ?
I would be glad about the answer
Nitaro
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: www redirects to non-www
Use forum search. Learn about nginx/apache www/non-www redirecting.
-
- Support team
- Posts: 1096
- Joined: Sat Sep 06, 2014 9:58 pm
- Contact:
- Os: Debian 8x
- Web: apache + nginx
Re: www redirects to non-www
you may be having an .htaccess file in your site root which has the redirect rule.
Re: www redirects to non-www
So, i figured out that this is caused by the force-https template.
Sorry, i forgot that i use it.
So i found in the force-https.tpl (/vesta/data/templates/web/nginx) the following line
and changed it to
To be safe, i´ve rebootet the server but the issue still exist.
It seems that changes on this file doesn´t work.
Is there another location where the template make changes ?
Sorry, i forgot that i use it.
So i found in the force-https.tpl (/vesta/data/templates/web/nginx) the following line
Code: Select all
rewrite ^(.*) https://%domain_idn%$1 permanent;
Code: Select all
rewrite ^(.*) https://%alias_idn%$1 permanent;
It seems that changes on this file doesn´t work.
Is there another location where the template make changes ?
-
- Support team
- Posts: 1111
- Joined: Tue Jul 30, 2013 10:18 pm
- Contact:
- Os: CentOS 6x
- Web: nginx + php-fpm
Re: www redirects to non-www
Make Rebuild Web after edit templates.
Re: www redirects to non-www
It works after rebuild!
Thank you grayfold.
Thank you grayfold.
-
- Posts: 1
- Joined: Fri Aug 31, 2018 5:41 am
- Os: Ubuntu 15x
- Web: apache + nginx
Re: non-www redirects to www
Hello, Now iam hosting a domain on vestapcp which is acessable in both versions like www.domain.com and domain.com , i want to redirect site to www.domain.com i have tried .htacess and it shows 500 error