Skip to content

Instantly share code, notes, and snippets.

@allella
Last active May 8, 2017 13:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save allella/ffdcf0a5dd9e147405b5 to your computer and use it in GitHub Desktop.
Save allella/ffdcf0a5dd9e147405b5 to your computer and use it in GitHub Desktop.
Let's Encrypt .htaccess to Fix Issues with Drupal or Wordpress Getting "cannot connect" Error
# add this before all other rewrite rules in your .htaccess
# backup your Apache file(s) first to avoid breaking things
# BE SURE TO TEST AND RELOAD APACHE AFTER MAKING THIS EDIT
# allow Let's Encrypt to access it's challenge file without the rewrite rules screwing them up
RewriteEngine On
RewriteRule "^.well-known/acme-challenge" - [L]
# Now, run an error check and reload Apache
/usr/sbin/apachectl configtest && /etc/init.d/httpd reload
# or, for CentOS 7
/usr/sbin/apachectl configtest && systemctl reload httpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment