Skip to content

Instantly share code, notes, and snippets.

@amorkovin
Last active August 2, 2019 16:48
Show Gist options
  • Save amorkovin/1a5f1b9d7e2203ac88a80f2e5378b966 to your computer and use it in GitHub Desktop.
Save amorkovin/1a5f1b9d7e2203ac88a80f2e5378b966 to your computer and use it in GitHub Desktop.
SERVER - URL страницы, на которой мы находимся WordPress
if ( !is_ssl() ) {
$https_url = 'https://'.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'];
wp_redirect( $https_url, 301 );
exit;
}
$_SERVER['DOCUMENT_ROOT'] — путь к корню сайта.
get_site_url().$_SERVER['REQUEST_URI'];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment