Last active
August 2, 2019 16:48
-
-
Save amorkovin/1a5f1b9d7e2203ac88a80f2e5378b966 to your computer and use it in GitHub Desktop.
SERVER - URL страницы, на которой мы находимся WordPress
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
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