We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d161a65 commit 7c70ebbCopy full SHA for 7c70ebb
force-https.php
@@ -27,13 +27,12 @@
27
return $overrides;
28
}, 999 );
29
30
-// force https redirection for all non-https requests
+// force https on frontend requests
31
add_action( 'init', 'force_https_redirect_non_https', 10 );
32
function force_https_redirect_non_https() {
33
if ( ! is_ssl() && ! is_admin() && PHP_SAPI !== 'cli' ) {
34
if ( ! headers_sent() ) {
35
- $redirect_url = home_url( add_query_arg( array(), null ) );
36
- wp_safe_redirect( set_url_scheme( $redirect_url, 'https' ), 301 );
+ wp_safe_redirect( set_url_scheme( home_url( $_SERVER['REQUEST_URI'] ), 'https' ), 301 );
37
exit;
38
}
39
0 commit comments