Skip to main content

“Error 401” when publishing to WordPress

If you are sure that you did everything right, but you still get error 401, the problem is in the server configuration. Try one of these solutions:

1. Open the .htaccess file with your host's built-in file manager or via FTP and add this line:

SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1

If that doesn't help, try adding these lines:

RewriteEngine On
RewriteCond %{HTTP:Authorization} ^(.*)
RewriteRule .* - [E=REMOTE_USER:%{HTTP:Authorization}]

2. Check whether your hosting lets you switch between Apache and Nginx and change the PHP version. Try changing these settings.