Skip to content

Instantly share code, notes, and snippets.

@jrobinsonc
Last active January 29, 2020 14:26
Show Gist options
  • Select an option

  • Save jrobinsonc/1d4826bdc28bc89d316ca08763523ede to your computer and use it in GitHub Desktop.

Select an option

Save jrobinsonc/1d4826bdc28bc89d316ca08763523ede to your computer and use it in GitHub Desktop.
WordPress - Redirect to HTTPS (SSL)
if (!is_ssl()) {
    wp_redirect('https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'], 301);
    exit;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment