• Resolved gamicord

    (@gamicord)


    Hello Sir,
    My website is a BuddyPress Community website.

    This in a way, means that few or more hundreds of people will be Logging in to Register and create Accounts on my website.

    Now, I don’t want these people to ever see the WP-Admin and the WP-Login.Php Pages.

    In short, I don’t want these my users to even know that a WP-Admin and Wp-Login.Php Page even exist.

    It should be that, even if people deliberately type “mydomain.com/wp-admin” or they deliberately type “mydomain.com/wp-login.php” , it should immediately and instantly redirect them to the Custom Login Page that I have created– and they should never see the “wp- admin and “wp-login.php” Page.

    Now, these people shouldn’t encounter a 404 Page if they deliberately type in these Admin URLs.

    Rather, I want them to be Redirected to Custom Pages.

    Can this plugin achieve such function for me?

    Regards.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Peter

    (@petersquirrly)

    ??Hi there,

    Thank you for your question!

    Yes, this can be 100% be achieved with our plugin.

    When activating one of two available modes (Safe & Ghost Modes), the option to hide wp-admin and wp-login will be activated by default.
    What this will do is that when somebody tries to access ?“mydomain.com/wp-admin” or “mydomain.com/wp-login.php”?they will be redirected to the homepage

    Furthermore, we offer the option to set a custom redirect for both admin and login paths to any page you want.

    At the same time, while the default WP paths are hidden, a custom path will be set instead. You can either use the default ones you’ll get from us, or change them and put whatever login path you want.

    Not the least, you have the option to hide your site from CMS and theme detectors.
    https://hidemywpghost.com/how-to-hide-from-wordpress-theme-detectors/

    If you have any other questions, don’t hesitate to let me know.

    Thread Starter gamicord

    (@gamicord)

    I have tried your plugin, but it is doing the wrong thing, and it is not working.

    Now, I have set my Custom Paths, as you can see here– https://prnt.sc/gpTxLAyH1-GT

    Unfortunately, the plugin is not doing its job!

    When I type wp-login.php, it still brings me to the Wp-Login Page, as you can see here– https://prnt.sc/WN4q1jNfHFbb

    Whereas, I expect it to bring me to my Custom Login Page seen here– https://prnt.sc/ggMAZBuzs41x

    You see, I have the below PHP Code Snippet:

    /**
    Block wp-admin access for non-admins
    */
    function restrict_wp_admin() {
    if (!current_user_can('administrator') && !is_admin()) {
    if (strpos($_SERVER['REQUEST_URI'], 'wp-admin/') === 0) { wp_redirect(home_url('/login')); // use desired slug
    exit;
    }
    }
    }
    add_action('admin_init', 'restrict_wp_admin');
    
    function restrict_wp_login() {
    if (strpos($_SERVER['REQUEST_URI'], 'wp-login.php') !== false && !is_user_logged_in() && !strpos($_SERVER['REQUEST_URI'], '/login/')) { wp_redirect(home_url('/login')); // use desired slug
    exit;
    }
    } add_action('init', 'restrict_wp_login');
    

    THE PROBLEM
    The problem I have is that, when this Code Snippet is active, the Custom Login Form does not work.

    But when this Code Snippet is disabled, the Custom Login Form works.

    WHAT I TRIED
    I did research to discover that wp-login.php controls Login, Logout and Password Resets.

    So, it appears as if my Code is blocking the wp-login.php from functioning properly.

    REQUEST
    I need my wp-login.php and my WP-Admin Pages to stay hidden to non-Admins– such that, even if they intentionally type “mydomain.com/wp-admin” or they intentionally type “mydomain.com/wp-login.php“, they should never ever see those Pages.

    Rather, they should be redirected to my Custom Login Page.

    Yet, my Custom Login Page should be able to work and function properly.

    QUESTION
    What are the step by step rules I need to follow, for your plugin to be able to do this for me?

    Or,

    2.) Can you Please help me modify and update my Code to be able to do what I want, if what I’m asking is outside the capability of your plugin?

    Regards.

    Plugin Support Peter

    (@petersquirrly)

    Thank you for the extensive From what I understand, you have the same /login path setup on Custom Login Form.

    Please try to change the custom wp-login path from Change Paths > Login security, from the current path login to anything else, such as new-login, or whatever you want. After which, check if you still face any same issues.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘redirection of Admin Pages to Custom Pages’ is closed to new replies.