For some strange reason I have experienced on one server that the RewriteRule in .htaccess is not working for cURL via the command line. The fix has been to add a User-Agent line to the header of the cURL command, like this:
curl --head --header "User-Agent: blablabla" https://dragly.org/
I have no idea why this happens, but I was pointed to this solution in a forum which I forgot to bookmark. I hope this might help you out if you should run into the same problem.