• Resolved brucewp

    (@brucewp)


    I installed this plugin I set the custom login to for example ‘xxx’ then a tried to login but the response is still 404 …
    last version of the plugin and last version of the wordpress

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support Simeon Boev

    (@k3llanved)

    Hello @brucewp,

    When a Custom Login URL is set, it changes the default WordPress login URLs (/wp-admin, /wp-login.php) to the custom URL of your choice. When enabled, all requests to the default login addresses will be redirected to 404 Not Found. Do you use a Membership plugin or a theme that leads the login pages to the default WordPress URLs?

    You can revert to the default login type by using the following snippet in the functions.php file of the active theme:
    add_action( 'init', 'remove_custom_login_url' );
    function remove_custom_login_url() {
    update_option( 'sg_security_login_type', 'default' );
    }

    Best Regards,

    Simeon Boev

    Thread Starter brucewp

    (@brucewp)

    Hi, @k3llanved

    I know the behavior, but I obtain only 404 responses.
    the URL is the correct one (set in config page).
    I found a way to rollback in case of a problem thanks!

    Also the default page returned 404

    My installation is on wordpress directory (I’m in test mode)

    My setup: Only this plugin active basic theme (Twenty Twenty-ThreeVersione: 1.0)

    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    Thread Starter brucewp

    (@brucewp)

    I’m a developer so some suggestions also a code-level, to investigate is appreciated

    The method
    – public function handle_request() {

    with mysite/wordpress/wp-login.php – is called
    with mysite/wordpress/mycustomlogin – no

    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    Plugin Support kuzmanstoyanov

    (@kuzmanstoyanov)

    Hello @brucewp,

    The issue could also be caused by a plugin conflict. It usually occurs if there is another plugin setting up a different custom login URL – security plugins or plugins that customize your WordPress login page.

    But this is definitely not expected behavior with only SiteGround Security and TwentyTwentyThree installed. I was unable to recreate it on my end.

    If you are a SiteGround customer, please contact our Technical Support team. This way we will able to access your website and investigate in detail.

    Regards,
    Kuzman Stoyanov

    Thread Starter brucewp

    (@brucewp)

    I looking in the code the problems I think is with subdirectory. The “?” Is stripped but after this we have the slug too. Instead without subdirectory the “?” Isnt stripped I think …

    Thread Starter brucewp

    (@brucewp)

    this function

        public static function get_url_path( $url ) {
    
            // Get the site url parts.
    
            $url_parts = parse_url( Helper_Service::get_site_url() );
    
            // Get the home path.
    
            $home_path = ! empty( $url_parts['path'] ) ? trailingslashit( $url_parts['path'] ) : '/';
    
            // Remove the query args from the url.
    
            $url = explode( '?', preg_replace( '|//+|', '/', $url ) );
    
            // Get the url path.
    
            $path = parse_url( $url[0], PHP_URL_PATH );
    
            //die(var_export("$home_path $path $url[0]", true));
    
            // Return the path without home path.
    
            return str_replace( $home_path, '', $path );
    
        }
    Thread Starter brucewp

    (@brucewp)

    https://computeplant.s2-tastewp.com/wp-admin
    https://computeplant.s2-tastewp.com/wp-login.php
    https://computeplant.s2-tastewp.com/wp-signup.php

    I not understand why this behaviour and not 404

    seems works without subdir

    But not understand why if I enter without submit in correct login … /wp-admin and /wp-login.php are accesible this is a big issue…

    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    Plugin Support kuzmanstoyanov

    (@kuzmanstoyanov)

    I confirm that SiteGround Security supports WordPress websites installed in subfolder. I tested the same setup with our plugin and TwentyTwentyThree theme installed and verified that the custom login page works properly. 

    Also, In the provided example, the default WordPress admin URLs redirect to 404 pages, which is expected behavior:

    Kuzman-Stoyanov:~ kuzman.stoyanov$ curl -I https://computeplant.s2-tastewp.com/wp-login.php
    HTTP/2 302
    date: Mon, 06 Mar 2023 03:37:55 GMT
    content-type: text/html; charset=UTF-8
    location: https://computeplant.s2-tastewp.com/404

    The same is expected to work for a website installed in a subfolder. 

    Have in mind that wp-login.php is only accessible for visitors that have accessed the custom login URL once. Still, if you try to login directly through wp-login.php as administrator, you will see the error below:

    ERROR: You are trying to login with an administrative account. Please, use the Custom Login URL instead.

    That being said, logging into the admin dashboard is only possible through the custom login URL.

    Regards,
    Kuzman Stoyanov

    Thread Starter brucewp

    (@brucewp)

    another note with this link it’s possible discover the login form
    https://computeplant.s2-tastewp.com/wp-login.php?q=/aaaaa&sgs-token=bbbb
    it’s corrects ?

    ok thanks I investigate further …

    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
    • This reply was modified 1 year, 8 months ago by brucewp.
Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘custom login doesn’t work’ is closed to new replies.