• Hello,

    We are having to use the plugin within a password-protected site using .htpassword This has been noted as a 401 auth error because the plugin needs access to the user:password first before attempting to make view/write to .htaccess

    Can I suggest that you add an indication that if a 401 error is received, that the plugin will inform to ask for the username and password to the basic authentication, before proceeding?

    This seems to currently affect the $config['redirect-to-existing-in-htaccess'] and the error message is misleading.

    Let me know how I can help if needed,

    Kind regards,
    Michael

Viewing 1 replies (of 1 total)
  • Thread Starter Michael Sumner

    (@xmic)

    I’ve went with a temporary solution by tweaking all mentions of wp_remote_get()
    and replacing them with wp_remote_request(), please see below that I hope will be implemented in the next release of the plugin:

    $username = 'myusername';
    $password = 'mypassword';
    $args = array(
        'headers' => array(
            'Authorization' => 'Basic ' . base64_encode($username . ':' . $password)
        ),
        'timeout' => 10,
        );
    $response = wp_remote_request($url, $args);

    Kind regards,
    Michael

    • This reply was modified 3 years, 10 months ago by Michael Sumner. Reason: re-format code
Viewing 1 replies (of 1 total)
  • The topic ‘HTTP Authentication (password-protected setup)’ is closed to new replies.