Skip to content

Instantly share code, notes, and snippets.

@SalmanRavoof
Created October 9, 2019 20:40
Show Gist options
  • Save SalmanRavoof/a423b3a5ed0e647b5129fd7fee363268 to your computer and use it in GitHub Desktop.
Save SalmanRavoof/a423b3a5ed0e647b5129fd7fee363268 to your computer and use it in GitHub Desktop.
Alternative way to force any HTTP request to redirect to HTTPS by adding the first three lines to your WordPress .htaccess file.
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.example.com/$1 [R=301,L,NE]
# Please make sure to replace the example.com domain name in line 3 with your own
# BEGIN WordPress
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment