Curl Strange Problem

I face a very strange problem with virtualmin configuration. We have and is an active site which operates in wordrpress and has implemented minification methods for code. Curl urls from php work just fine. In the same server we have and some other sites. They are developed with wordpress too and have the same plugins for minification. But here comes the strange part. When we curl the minified urls we get a 404 response from And the code that is being returned is the 404 html code of the which breaks the site (for css and js).
Have anyone faced the same problem with curl for all domains except the servername domain in virtual servers?