Skip to content

Instantly share code, notes, and snippets.

@jesders
Last active April 1, 2019 17:27
Show Gist options
  • Save jesders/ce2336c46a3fe41aff352c03e80cf74d to your computer and use it in GitHub Desktop.
Save jesders/ce2336c46a3fe41aff352c03e80cf74d to your computer and use it in GitHub Desktop.
htaccess rule for forcing https
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.domain.com/$1 [R=301,L,NE]
# Redirect this entire domain, abc.com, to the domain xyz.com
RedirectMatch 301 ^(.*)$ http://www.xyz.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment