Bluehost is using Let’s Encrypt to provide free SSL certs to all sites. I spoke to their support today because my htaccess file was molested and caused Error 500 on some of my sites. They confirmed it was a bug with Let’s Encrypt and there’s nothing they can do about it. The issue is that htaccess files are being tampered with and RewiteCond are being added redundantly to the file and in the wrong places, sometimes inserting 4 lines for every 1 line in the file.
I’ll attempt to copy/paste the contents of one of my htaccess files below in a “hide details” field so you can see what happened.
Summary
#Options +Indexes
RewriteEngine On
HTTPS
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
Enforce no trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?
RewriteRule ^ %1 [R=301,L]
Pretty URLs
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?
RewriteRule ^pet-sitting pet-sitting.php
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?
RewriteRule ^dog-training dog-training.php
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?
RewriteRule ^products products.php
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?
RewriteRule ^forms contracts.php
Pretty URLs (used for offline testing)
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?
RewriteRule ^/animal-aide/pet-sitting /animal-aide/pet-sitting.php
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?
RewriteRule ^/animal-aide/dog-training.php /animal-aide/dog-training.php
RewriteCond %{REQUEST_URI} !^/.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/.well-known/pki-validation/[A-F0-9]{32}.txt(?:\ Comodo\ DCV)?
RewriteRule ^/animal-aide/products /animal-aide/products.php
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/.well-known/cpanel-dcv/[0-9a-zA-Z_-]+
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/(?:\ Banana616)?
RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?
RewriteRule ^/animal-aide/forms /animal-aide/contracts.php
Redirect mistyped or misremembered urls to /forms
Redirect /contracts /forms
Redirect /contract /forms
Redirects errors to the index
ErrorDocument 404 /redirect-to-index.php
ErrorDocument 403 /redirect-to-index.php