In string http:// double slash (//) confuses sed, as they are part of sed syntax. You need to replace // with \/\/ to disable its special meaning. For example:
Code:
URL="http://old.com"
olddomain="old.com"
newdomain="new.com"
echo $URL | sed "/http:\/\//s/$olddomain/$newdomain/g"
Modify your script and it should work now