Hey Patricia!
I've had to work with similar issues, so here's a few things I had to check...
1) in the attachements table, what is the directory? We've found in most of our applications, it isn't stored with the URL, but with a file path. To resolve this, I use a replace function in my query or I have a copy of the attachements table and update it to the correct path.
2) once in a while, there's a "root folder" or something similar... If you find that, replace it with your URL.
If it isn't either of those, could you provide some code or more information?