SSL redirect to naked domain only
SSL redirect to naked domain only
Hi everybody,
I followed this guide https://vestacp.com/docs/#how-to-force-https ,
This works fine but it always remove the "www",
Does anybody faced this problem and found a solution?
I downloaded the files but I don't know if there is something "wrong" there, this is what I found
I followed this guide https://vestacp.com/docs/#how-to-force-https ,
This works fine but it always remove the "www",
Does anybody faced this problem and found a solution?
I downloaded the files but I don't know if there is something "wrong" there, this is what I found
Code: Select all
server {
listen %ip%:%proxy_port%;
server_name %domain_idn% %alias_idn%;
location / {
rewrite ^(.*) https://%domain_idn%$1 permanent;
}
}
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: SSL redirect to naked domain only
In your config you use this code:
Here you say, rewrite everything to https://yourdomain.com. I think you need to change this to:
Code: Select all
rewrite ^(.*) https://%domain_idn%$1 permanent;
Code: Select all
rewrite ^(.*) https://www.%domain_idn%$1 permanent;
Re: SSL redirect to naked domain only
I've already tried that, I rebooted but it doesn't work.
Does anyone know how to investigate?
I'm just trying to learn.
Does anyone know how to investigate?
I'm just trying to learn.