This is a common problem.
You can usually fix things by using relative URLs rather than those with the absolute URL. But ... you still have to fix all of them.
There is a free module, F3, from Engage Software that can be used to do global search/replace in the HTML modules in a site. There is a SQL script to do the work here:
Find and Replace SQL queries for DotNetNuke
(To fix problems after transferring a localhost database to a live website and other useful functions)
Unfortunately, neither of these work for DotNetNuke 5.x because the Text/HTML module now includes version number. I made a simple change to the script to modify the most recent version. Perhaps we can get that uploaded to the site soon. But ... it really should create a new version and NOT modify the last one so maybe I should do some additional work ...