"Ha det bra" is indeed a Norwegian goodbye.
Literally, it's something like "have it good", as in have a good however long. Good/nice/whatever. Nice life, nice day, etc.
One of the lesser used English farwells that have a similar tone is "Best wishes". Or, thinking about it, "Fare well". Just a...