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 Works only for non www

General questions about VestaCP
Post Reply
  • Print view
Advanced search
6 posts • Page 1 of 1
e.htabar
Posts: 20
Joined: Mon Apr 11, 2016 1:53 pm

SSl Works only for non www
  • Quote

Post by e.htabar » Mon Dec 26, 2016 12:54 pm

Hi There

I use Let's Encypt to make http://domian.com as https and added
{
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.domian\.com [NC]
RewriteRule ^(.*)$ https://domian.com/$1 [L,R=301]
}
to htaccess.

I tried to redirect https://www.domian.com to https://domian.com, but without success. However, http://www.domian.com (without ssl protocol) redirects to https://bidbarg.com. Can you do me a favor and help me on this isuue?

I face this problem only in firefox and IE, however in chrome it works.
Top

indteam
Posts: 12
Joined: Fri Jul 01, 2016 8:21 am

Re: SSl Works only for non www
  • Quote

Post by indteam » Mon Dec 26, 2016 2:12 pm

Try

Code: Select all

RewriteCond %{SERVER_PORT} 443
RewriteCond %{HTTP_HOST} ^www[.].+$
RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]
Certificate must cover both www and non-www https. Some provider's certs cover both for www.domain.com, but only one for domain.com.
Top

Mr.Erbutw
Posts: 1040
Joined: Tue Apr 29, 2014 10:05 pm

Os: CentOS 6x
Web: apache + nginx
Re: SSl Works only for non www
  • Quote

Post by Mr.Erbutw » Mon Dec 26, 2016 2:16 pm

Code: Select all

RewriteRule ^(.*)$ https://domain.com/$1 [L,R=301]
If not a single domain. If the domain is connected, the aliases will be forwarded to https,
then you need so

Code: Select all

# redirect to https site
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [NC,R=301,L]
# redirect to www site
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^(.*)$ http://www.%1/$1 [L,R=301]
Top

e.htabar
Posts: 20
Joined: Mon Apr 11, 2016 1:53 pm

Re: SSl Works only for non www
  • Quote

Post by e.htabar » Mon Dec 26, 2016 2:36 pm

Thank you for Answering

but this Certificate only for non-www !

Image

https://bidbarg.com/
https://www.bidbarg.com/
Top

Mr.Erbutw
Posts: 1040
Joined: Tue Apr 29, 2014 10:05 pm

Os: CentOS 6x
Web: apache + nginx
Re: SSl Works only for non www
  • Quote

Post by Mr.Erbutw » Mon Dec 26, 2016 5:53 pm

Image
Image

the site only works fine on http://www.bidbarg.com but without bidbarg.com not displayed normally
Top

e.htabar
Posts: 20
Joined: Mon Apr 11, 2016 1:53 pm

Re: SSl Works only for non www
  • Quote

Post by e.htabar » Tue Dec 27, 2016 5:44 am

Mr.Erbutw wrote:Image
Image

the site only works fine on http://www.bidbarg.com but without bidbarg.com not displayed normally
I changed Https to Http
Top


Post Reply
  • Print view

6 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