Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

SSL redirect to naked domain only

General questions about VestaCP
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
Harry77
Posts: 10
Joined: Tue Jun 28, 2016 5:51 am

SSL redirect to naked domain only
  • Quote

Post by Harry77 » Sat Sep 10, 2016 6:06 am

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

Code: Select all

server {
    listen      %ip%:%proxy_port%;
    server_name %domain_idn% %alias_idn%;
    location / {
        rewrite ^(.*) https://%domain_idn%$1 permanent;
    }
}
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: SSL redirect to naked domain only
  • Quote

Post by tjebbeke » Mon Sep 12, 2016 9:08 am

In your config you use this code:

Code: Select all

rewrite ^(.*) https://%domain_idn%$1 permanent;
Here you say, rewrite everything to https://yourdomain.com. I think you need to change this to:

Code: Select all

rewrite ^(.*) https://www.%domain_idn%$1 permanent;
Top

Harry77
Posts: 10
Joined: Tue Jun 28, 2016 5:51 am

Re: SSL redirect to naked domain only
  • Quote

Post by Harry77 » Wed Sep 14, 2016 5:26 am

I've already tried that, I rebooted but it doesn't work.
Does anyone know how to investigate?
I'm just trying to learn.
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password