• I was google’ing like a person that just escaped a loony bin for a way
    that could make the ‘wp-login-php’ more safe, but I wouldn’t find an
    easy way, so I started to think about my VERY LITTLE knowledge of php.
    I googled that too and after testing it, it seemed to work.

    What I needed was a “new/different” directory so I could create the
    file; ‘.htaccess’ but since this file (wp-login) was in the “root”
    of the installation I couldn’t just put the file there hence making
    all public browsers need to login and that ain’t good ??

    I created a directory under the wordpress “root-dir”.
    eg. the file /MySite/wp-login.php, thus the dir. xyz is like:
    /MySite/xyz

    In that dir I created the ‘.htaccess’ file and then I ‘hacked’ the
    wp-login.php file and added this absolutely first in the file,
    well after “<?php”; (DUH!! ?? )

    chdir("yourowndirname");
    chdir("../");

    This will make a dir change into the dir where the .htaccess file is
    thus forcing it to ask for account/password
    and then it changes the dir back to where is first was, in this case
    one dir up. This dir could be placed anywhere as long as you write
    that dir-name in this ‘chdir’-statement.

    If anyone test this and it won’t work, let me know so I’ll know
    that I can’t use it ??
    I tested it on 3 different computers, with 2 different browsers on
    each computer and mobile devices and it works.

    If it DOES work, well, then I hopefully has helped someone that,
    like me, didn’t find a solution through google ??

    This is DEFINITELY!! one thing the developers should think about
    NOT to get to a login-page this easy!!!!

    //GL

  • The topic ‘A small 'hack' to get "wp-login" more secure’ is closed to new replies.