• Resolved tonyastley

    (@tonyastley)


    When viewing the 404 page the wp_login_url does not work.

    Viewing a normal page ‘wp_login_url’ returns the correct url (eg: https://sitedomain/new_login).

    The exact same code when viewing the 404 page returns a hash (https://sitedomain/#)?

    Is there something about the 404 page that causes this to happen with WPS Hide Login?

    When deactivating the WPS plug-in both pages show the standard login url (wp-login.php)

    • This topic was modified 9 months ago by tonyastley.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support MaximeWPS

    (@seinomedia)

    Hello,

    Thanks for using WPS Hide Login.

    I don’t understand very well. When WPS Hide Login is activated, you can reach your secret slug but wp-login.php doens’t redirects to 404. That’s right ?

    Thread Starter tonyastley

    (@tonyastley)

    Hello,

    I’m calling the function as follows:

    <a href="<?php echo wp_login_url(); ?>" title="Login">Login</a>

    On every page apart from the 404 page, the link is correctly populated with the secret login url.

    <a href="https://mysite.com/secret_login" title="Login">Login</a>

    On the 404 page the url is returned as a hash symbol:

    <a href="#" title="Login">Login</a>

    This only happens on the 404 page, every other page I have checked is OK.

    • This reply was modified 9 months ago by tonyastley.
    Plugin Support MaximeWPS

    (@seinomedia)

    I’m not sure this issue is due to WPS Hide Login.

    What is the theme you’re using ?

    Thread Starter tonyastley

    (@tonyastley)

    I tested this with a vanilla install of 6.7.2 and the most basic of themes (the 3 files below). I installed only WPS hide login and the issue is still there.

    style.css

    /*
    Theme Name: New Theme
    Theme URI: http://newtheme.com
    Description: A description about the theme
    Author: Author Name
    Author URI: http://www.author.com
    Version: 1.0
    */

    index.php (displays login url correctly)

    <!DOCTYPE html>
    <html>
    <head>
    <title>My website</title>
    </head>
    <body>
    <h2>Content Title</h2>
    <p><a href="<?php echo wp_login_url(); ?>" title="Login"><?php echo wp_login_url(); ?></a></p>
    </body>
    </html>

    404.php

    <!DOCTYPE html>
    <html>
    <head>
    <title>Page Not Found</title>
    </head>
    <body>
    <h2>Page Not Found</h2>
    <p><a href="<?php echo wp_login_url(); ?>" title="Login"><?php echo wp_login_url(); ?></a></p>
    </body>
    </html>

    Is there something obvious I am missing here?

    Thread Starter tonyastley

    (@tonyastley)

    Just to re-iterate, it’s only the 404.php that this happens on, every other page works OK:

    search.php – fine
    privacy-policy.php – fine

    etc

    Plugin Support MaximeWPS

    (@seinomedia)

    Ok, I understand.

    2 explainations :

    1. It’s a security rule to prevent robots from finding any occurrence of you secret login on 404 page.
    2. If you enable anyone to find your secret URL on your WordPress pages and to log in, WPS Hide Login is useless. Its usefulness is to hide the login page and in your case, it’s shown to everyone.
Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘wp_login_url doesn’t work on 404 page when WPS Hide Login is Activated’ is closed to new replies.