Guoshu Zhang
Guoshu Zhang

Reputation: 13

.htpasswd asking for authentication on the whole site

The screen shot from ChromeI use Vultr wordpress one click installation service . they have .htaccess file to protect me to login in wp-admin , but today after I changed the theme , it asks for authentication on all the pages of my site . I don't get any error after I click cancel the authentication window , similar problem as this guy https://wordpress.stackexchange.com/questions/103697/htpasswd-asking-for-authentication-on-home-page

I check the .htaccess file on my site , I found it is empty , there is no code there . What should I do to solve the problem .

You could see the popup window by visiting my site : www.hermoart.com

Sincerely looking for help ;(

Upvotes: 1

Views: 819

Answers (1)

Argus Duong
Argus Duong

Reputation: 2654

If you correct about using WordPress one click application when deploy new server then they're not using Apache but Nginx, so .htaccess files is useless.

Your website have a request to https://www.hermoart.com/wp-admin/js/password-strength-meter.min.js?ver=5.1.1, which causing this issue.


From Vultr docs: https://www.vultr.com/docs/one-click-wordpress

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.

  1. Login to your server using ssh as root.
  2. Create a backup of your vhost files: cp /etc/nginx/conf.d/*.conf /root/
  3. Edit both vhost files in /etc/nginx/conf.d/. You need to remove the block of code that starts with location ^~ /wp-admin/. It is about 15 lines long.
  4. Save your changes, and restart the web server: systemctl restart nginx.service && systemctl restart php7.2-fpm.service (PHP version may vary)

Upvotes: 1

Related Questions