The http:// gets stripped somehow. So you redirect to forum.freecodecamp.com instead of http://forum.freecodecamp. Since it misses http, express will think you used a relative url.
EDIT: I guess this is the problem: var url = req.url.replace(/.*:\/\//g, '');