Skip to content

Instantly share code, notes, and snippets.

@sumonst21
Created August 2, 2023 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sumonst21/8d3187468aad72cf8816e00306af3720 to your computer and use it in GitHub Desktop.
Save sumonst21/8d3187468aad72cf8816e00306af3720 to your computer and use it in GitHub Desktop.
mod_rewrite - htaccess redirect http to https
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment