Skip to content

Instantly share code, notes, and snippets.

@ravismakwana
Created February 16, 2023 12:13
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 ravismakwana/c9a041195d8d30c0550f1efb742a200b to your computer and use it in GitHub Desktop.
Save ravismakwana/c9a041195d8d30c0550f1efb742a200b to your computer and use it in GitHub Desktop.
This code is used to redirect 'http' to 'https' in WordPress.
/* Add this code at the top of the .htaccess file */
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment