Created
August 15, 2024 18:29
-
-
Save JuniorTak/6527e36fbd52c46ab7e7f7a391604251 to your computer and use it in GitHub Desktop.
To force traffic to HTTPS using .htaccess file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# HTTP to HTTPS force redirection | |
RewriteEngine On | |
RewriteCond %{HTTPS} off | |
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this code snippet above the # BEGIN WordPress .htaccess lines., otherwise, they will be overwritten by WordPress.