Title: custom login doesn&#8217;t work
Last modified: March 5, 2023

---

# custom login doesn’t work

 *  Resolved [brucewp](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/)
 * 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](https://wordpress.org/support/users/k3llanved/)
 * (@k3llanved)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530068)
 * Hello [@brucewp](https://wordpress.org/support/users/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](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530082)
 * Hi, [@k3llanved](https://wordpress.org/support/users/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 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
 *  Thread Starter [brucewp](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530099)
 * 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 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
 *  Plugin Support [kuzmanstoyanov](https://wordpress.org/support/users/kuzmanstoyanov/)
 * (@kuzmanstoyanov)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530336)
 * Hello [@brucewp](https://wordpress.org/support/users/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](https://www.siteground.com/tutorials/getting-started/getting-help-from-our-support-team/).
   This way we will able to access your website and investigate in detail.
 * Regards, 
   Kuzman Stoyanov
 *  Thread Starter [brucewp](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530378)
 * 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](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530384)
 * this function
 *     ```wp-block-code
           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](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530408)
 * [https://computeplant.s2-tastewp.com/wp-admin](https://computeplant.s2-tastewp.com/wp-admin)
   
   [https://computeplant.s2-tastewp.com/wp-login.php](https://computeplant.s2-tastewp.com/wp-login.php)
   [https://computeplant.s2-tastewp.com/wp-signup.php](https://computeplant.s2-tastewp.com/wp-signup.php)
 * ~I not understand why this behaviour and not 40~4
 * 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 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
 *  Plugin Support [kuzmanstoyanov](https://wordpress.org/support/users/kuzmanstoyanov/)
 * (@kuzmanstoyanov)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530735)
 * 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 302date: Mon, 06 Mar 2023 03:37:55 GMTcontent-type: text/
   html; charset=UTF-8location: [https://computeplant.s2-tastewp.com/404](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](https://wordpress.org/support/users/brucewp/)
 * (@brucewp)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530874)
 * ~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](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 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).
    -  This reply was modified 3 years, 3 months ago by [brucewp](https://wordpress.org/support/users/brucewp/).

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘custom login doesn’t work’ is closed to new replies.

 * ![](https://ps.w.org/sg-security/assets/icon-256x256.gif?rev=2971855)
 * [Security Optimizer - The All-In-One Protection Plugin](https://wordpress.org/plugins/sg-security/)
 * [Support Threads](https://wordpress.org/support/plugin/sg-security/)
 * [Active Topics](https://wordpress.org/support/plugin/sg-security/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/sg-security/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/sg-security/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [brucewp](https://wordpress.org/support/users/brucewp/)
 * Last activity: [3 years, 3 months ago](https://wordpress.org/support/topic/custom-login-doesnt-work-2/#post-16530874)
 * Status: resolved