Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Karting06/622b377da213d2551124baeacce75d7b to your computer and use it in GitHub Desktop.
Save Karting06/622b377da213d2551124baeacce75d7b 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