此前总有提示输入密码,虽然不爽也没工夫解决,后来研究了一下,也就几分钟的事情,现在好用了,大家可以试试。
Removing wp-admin
Login Prompt
For security purposes, your WordPress app has an initial login prompt that opens when accessing the /wp-admin/
page. To remove this prompt, follow these steps.
If your instance was deployed after December 1st 2019 we have included a script for your convenience to do this for you.
- Login to your server using
ssh
as root.
- Run the command
/opt/vultr/remove-htaccess.sh
If your instance was deployed before that date it will need to be done manually.
- Login to your server using
ssh
as root.
- Create a backup of your vhost files:
cp /etc/nginx/conf.d/*.conf /root/
- Edit both vhost files in
/etc/nginx/conf.d/
. You need to remove the block of code that starts withlocation ^~ /wp-admin/
. It is about 15 lines long.
- Save your changes, and restart the web server:
systemctl restart nginx.service && systemctl restart php7.2-fpm.service
( PHP version may vary )