A question about WP-CLI command.
-
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 ago by
hack3rcon.
-
This topic was modified 5 years ago by
-
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…?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.
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.That’s HTTP Authentication, not something controlled by WordPress, so it can’t be set by WP-CLI.
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>
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-userFor WordPress can I use “.htpasswd2”?
You can use the same file or delete a new file.
AuthUserFileis where you’ll do that.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 AllThen 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?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!!!
The topic ‘A question about WP-CLI command.’ is closed to new replies.