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 Web Server
  • Search

Letsencrypt adding extra www. to reference call

Questions regarding the Web Server
Apache + Nginx, Nginx + PHP5-FPM
Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
revelnode
Posts: 22
Joined: Thu Jan 19, 2017 8:54 pm

Os: CentOS 6x
Web: apache
Letsencrypt adding extra www. to reference call
  • Quote

Post by revelnode » Wed Dec 20, 2017 9:13 pm

Hello,

One of my domains seems to be contaminated, and I don't know how to fix permanently.
A few months back I got an email from the cron stating the following:

Code: Select all

Error: Fetching https://www.www.mydomain.com/.well-known/acme-challenge/(bunch of random chars): Error getting validation data
I searched for hours and could not find any reference to why it's doubling the www (www.www.mydomain.com). I got around this by completely deleting the domain form the system and re-adding it, waisting hours backing up and reinitializing everything on that domain. I thought this fixed it, but again today, I get the same message, for the same domain. The strange thing is, no other domain has this issue.

Can someone point me in the right direction as to how to fix this permanently, I don't want to have to delete my site every 3 months.

Regards,
Matthew
Top

revelnode
Posts: 22
Joined: Thu Jan 19, 2017 8:54 pm

Os: CentOS 6x
Web: apache
Re: Letsencrypt adding extra www. to reference call
  • Quote

Post by revelnode » Wed Dec 20, 2017 9:22 pm

Of course, the second I post this, I had an epiphany... Check the .htaccess file:

Code: Select all

       #To redirect users to the secure version of your site, uncomment the lines below
        RewriteCond %{HTTPS} !=on
        RewriteRule .* https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
        RewriteCond %{SERVER_NAME} !^www\. [NC]
        RewriteRule ^(.*)$ https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
The 3rd line which states, no matter what, put a www. in front of the server name... which of course is stupid, cuz if you ask for a http://www.anydomian.com it will push it to https://www.www.anydomain.com. The fourth and fifth lines handle non "www." requests, forcing anydoamin.com to https://www.anydomain.com.

So I updated it:

Code: Select all

       #To redirect users to the secure version of your site, uncomment the lines below
        RewriteCond %{HTTPS} !=on
        RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
        RewriteCond %{SERVER_NAME} !^www\. [NC]
        RewriteRule ^(.*)$ https://www.%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Seems to work now from a web standpoint... will have to see now if Letsencrypt picks up on the change.
Top


Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Web Server”



  • 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