Is there anything other way?

If I do that it would mean alot of extra work scanning and replacing database values to make it work with the dev and staging servers.

Also this problem wasn’t there before. This site is a rebuild and the old one I never changed the site URL ever, yet didn’t have this issue with ure.