Subscribe to How-To Geek

Force WordPress Login Page to Use SSL/HTTPS

From HowToGeek

Jump to: navigation, search

If you want to force just the wordpress login page to use the SSL certificate you've installed on your server, you can add the following snippet of code to your wp-config.php file, or even just throw it into a simple plugin.

You'll need to make sure you've configured SSL properly before you do this, of course.

if($_SERVER["REQUEST_URI"] == "/wp-login.php" && $_SERVER["HTTPS"] != "on") {
        $newurl = "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
        header("Location: $newurl");
        echo $newurl;
        exit();
}

 

Our Friends
Getting Started
About How-To Geek
What Is That Process?
svchost.exe
jusched.exe
dwm.exe
ctfmon.exe
wmpnetwk.exe
wmpnscfg.exe
rundll32.exe
wfcrun32.exe
Ipoint.exe
Itype.exe
Wfica32.exe
Mobsync.exe
Cmd.exe
Dpupdchk.exe Adobe_Updater.exe

All content on the How-To Geek Wiki is licensed under a Creative Commons License