Title: HTTP Authentication (password-protected setup)
Last modified: May 27, 2021

---

# HTTP Authentication (password-protected setup)

 *  [Michael Sumner](https://wordpress.org/support/users/xmic/)
 * (@xmic)
 * [5 years ago](https://wordpress.org/support/topic/http-authentication-password-protected-setup/)
 * 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](https://wordpress.org/support/users/xmic/)
 * (@xmic)
 * [5 years ago](https://wordpress.org/support/topic/http-authentication-password-protected-setup/#post-14489518)
 * 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 5 years ago by [Michael Sumner](https://wordpress.org/support/users/xmic/).
      Reason: re-format code

Viewing 1 replies (of 1 total)

The topic ‘HTTP Authentication (password-protected setup)’ is closed to new replies.

 * ![](https://ps.w.org/webp-express/assets/icon.svg?rev=1918288)
 * [WebP Express](https://wordpress.org/plugins/webp-express/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/webp-express/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/webp-express/)
 * [Active Topics](https://wordpress.org/support/plugin/webp-express/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/webp-express/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/webp-express/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [Michael Sumner](https://wordpress.org/support/users/xmic/)
 * Last activity: [5 years ago](https://wordpress.org/support/topic/http-authentication-password-protected-setup/#post-14489518)
 * Status: not resolved