Define WordPress URLs using SERVER_NAME

Introduction I was frustrated by the predefined WordPress URL and wanted a way to migrate wordpress installations easier. I use different domain names for my different stages of developement (e.g. dev.domain.tld, test.domain.tld, acc.domain.tld, www.domain.tld) because I don’t like having to alter my hosts file for this purpose.