• I have set up common basic auth (only for development purpose) on wordpress installation by using this “.htaccess”:

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    
    # BEGIN AuthType 
    AuthType Basic
    AuthName "Protected Area"
    AuthUserFile /homepages/xxxxxx/wordpress/.htpasswd
    Require valid-user
    # END AuthType

    with a valid “.htpasswd”.

    However, when visiting the wordpress site, the browser prompts the basic auth for every link and every file. I am using https and all works however, the browser should prompt for basic auth only once and not every time when user navigates through the site. What is wrong?

Viewing 2 replies - 1 through 2 (of 2 total)
  • This is not a WordPress question.
    According to https://httpd.apache.org/docs/current/howto/auth.html it looks correct, but to get answers for non-WordPress things, it’s best that you ask somewhere that the topic is known.

    Thread Starter nimo24

    (@nimo24)

    Using a “static” webpage with no wordpress/php, the same basic auth setup with .htaccess works without prompting the user again and again on each page link..so it has to do with wordpress.

    In https://de.www.ads-software.com/plugins/http-digest-auth/, it is described that

    If you are using FastCGI PHP this plugin may keep prompting for the credentials even if you enter the right pair, in this case use the following in your .htaccess file

    (I dont use this plugin.)

    <IfModule mod_setenvif.c>
    SetEnvIfNoCase ^Authorization$ "(.+)" PHP_AUTH_DIGEST=$1
    </IfModule>

    However, I dont use digest auth but basic auth, the above leads to HTTP-Error “500 Internal Server Error”.

    I try this https://www.coderrr.com/using-http-auth-basic-wordpress/ instead of using basic auth in .htaccess.

    Or maybe someone knows a simpler solution by using proper .htaccess setup?

    • This reply was modified 5 years, 7 months ago by nimo24.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘basic auth prompts in loop’ is closed to new replies.