Has anyone had any issues with AutoSSL not renewing atomically due to issues with the Drupal .htaccess file? I had a site that the cPanel AutoSSL would not renew it took a week with talking to the support chat to figure out it was an issue with the .htaccess file that was causing the issue.

Their response was:

The source of the error was the Drupal .htaccess file located in the public_html folder, specifically the rewrite rules Drupal uses to interpret virtual URLs in order to serve content. I temporarily disabled the .htaccess file, and was then able to successfully complete the AutoSSL installation. The site is now loading properly with HTTPS.

The only thing I ever add to the .htaccess file is to the bottom and it is the following lines.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [L,R=301]

Just so the site auto forward to https://

Looking for any thought or recommendations on what to maybe fix or alter to this doesn't happen with my other sites hosted on my dedicated server.

Comments

onejam’s picture

Use this:

  RewriteCond %{HTTP_HOST} !^example\.com$ [NC,OR]
  RewriteCond %{HTTPS} off
  RewriteRule ^(.*)$ https://example.com/$1 [R=301,L]

Replace example.com with your own.

-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien

ryanfc78’s picture

Thank you. I have replaced mine with yours. I am still getting an error on the Log for the AutoSSL were it says"

4:46:18 AM Checking websites for “example” …
4:46:18 AM The website “example.com”, owned by “example”, has a valid SSL certificate, but additional SSL coverage may be possible for the domains “mail.example.com”, “cpanel.example.com”, “webmail.example.com”, and “webdisk.example.com”. The system will attempt to replace this certificate with one that includes these additional domains.
4:46:31 AM WARN The domain “example.com” failed domain control validation: “example.com” does not resolve to any IPv4 addresses on the internet.
4:46:31 AM WARN The current SSL certificate for “example.com” secures the domain “example.com”. However, this domain failed local domain control validation. In order to maintain SSL domain coverage for this domain, the system will not attempt to replace the current certificate.
4:46:31 AM The system has completed the AutoSSL check for “example”.

So it is not auto renewing for mail, webmail, webdisk and channel. Not sure what is causing that issue. I have other domains on my dedicated server that are not having this issue and it renews all of the AutoSSL certificates. Not sure why that one gives me the issue but others don't.

onejam’s picture

You are using cpanel. You might want to check this post: https://forums.cpanel.net/threads/autossl-domain-failed-domain-control-v...

-----------------------------------------------------------------
We build engaging websites and intuitive designs that will benefit your business.
Duvien