.htaccess-Password is blocking cURL .htaccess-Password is blocking cURL curl curl

.htaccess-Password is blocking cURL


You can define the HTTP Auth username and password like this:

curl -u username:password http://...

This way you don't have to disable the HTTP Auth while accessing it from a browser but can access it from your script.

EDIT: If working with the PHP CURL object you can also define it as such:

curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");