• Hello,
    Can I set a password for the WordPress admin page or change the URL of it?

    Thank you.

    • This topic was modified 5 years, 3 months ago by hack3rcon.
Viewing 11 replies - 1 through 11 (of 11 total)
  • Moderator James Huff

    (@macmanx)

    Thread Starter hack3rcon

    (@hack3rcon)

    Thank you, but I meant was set a password for see the WordPress admin page. For example, when I browse “https://mywebsite.com/wp-admin ” then it ask me a username and password then show the admin page.
    About the second question, can I change “https://mywebsite.com/wp-admin ” to “https://mywebsite.com/wproot ” or…?

    Moderator James Huff

    (@macmanx)

    For example, when I browse “https://mywebsite.com/wp-admin ” then it ask me a username and password then show the admin page.

    WordPress already operates that way. If you visit /wp-admin/ but aren’t logged in yet, you’re sent to wp-login.php where it asks for your username and password.

    can I change “https://mywebsite.com/wp-admin ” to “https://mywebsite.com/wproot

    No, that cannot be done via WP-CLI.

    Thread Starter hack3rcon

    (@hack3rcon)

    Thanks, but I must explain more.
    I know that for logging to the WordPress admin dashboard, I must enter the username and password, but I meant was set a password for seeing that page. Something like: PhpMyAdmin
    Set a username and password for the Login Interface.

    Moderator James Huff

    (@macmanx)

    That’s HTTP Authentication, not something controlled by WordPress, so it can’t be set by WP-CLI.

    Thread Starter hack3rcon

    (@hack3rcon)

    Thank you.
    Thus, it must handle by Apache? If yes, then how can I change below lines to set a password for WordPress logging page?

    <Directory /usr/share/phpmyadmin>
        AuthType Basic
        AuthName "Restricted Content"
        AuthUserFile /etc/httpd/.htpasswd
        Require valid-user
    </Directory

    >

    Moderator James Huff

    (@macmanx)

    Thread Starter hack3rcon

    (@hack3rcon)

    Thank you so much.
    I am already using “htpasswd” for protecting “PhpMyAdmin”, Can I have two different “htpasswd” file? One for PhpMyAdmin and another for WordPress.
    For “PhpMyAdmin” I did:
    # htpasswd -c /etc/httpd/.htpasswd "Panel User"
    Then, create the “.htaccess” file within the “PhpMyAdmin” directory with below lines:

    AuthType basic
    AuthName "Authentication Required"
    AuthUserFile /etc/httpd/.htpasswd
    Require valid-user

    For WordPress can I use “.htpasswd2”?

    Moderator James Huff

    (@macmanx)

    You can use the same file or delete a new file. AuthUserFile is where you’ll do that.

    Thread Starter hack3rcon

    (@hack3rcon)

    Thank you.
    I added another file with below command:
    # htpasswd -c /etc/httpd/.WPhtpasswd "Panel User"
    In the root directory of the WordPress, a “.htpasswd” file existed and added below lines at the end of it:

    AuthType Digest
    AuthName "Password Protected"
    AuthDigestDomain /wp-login.php https://www.MyWebSite.com/wp-login.php
    AuthUserFile /etc/httpd/.WPhtpasswd
    Require valid-user
    Satisfy All

    Then restarted the Apache service and when I browse the WordPress admin dashboard, then it asks me the username and password, but it doesn’t work!!!
    Can it because that I used the same username in “Panel User” for the phpMyAdmin and WordPress?

    Thread Starter hack3rcon

    (@hack3rcon)

    Hello,
    I added above lines, but it asks me the username and password for visit the website and not just “wp-login.php”.
    How can I solve it?
    I guess that I shouldn’t add the above lines in the “.htpasswd” file under the WordPress directory!!!

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

The topic ‘A question about WP-CLI command.’ is closed to new replies.