views:

262

answers:

1

This is more of a best practice question. At our company we often have the requirement to transfer a website from one server to another. DNS takes a while to update so it's often nice to be able to tell when a site has transferred to the new server, even if there are no changes to the actual website itself.

My thought was to set a response header with the host server name so I could easily check when a site is serving from the new host. In Apache this can be achieved with something like:

Header append Server-Host "servername.studio24.net"

Which gives me the response header:

Server-Host: servername.studio24.net

Is this a good idea? Or should I not be using HTTP response headers for this kind of thing?

A: 

The convention is to tack "X-" to the front of nonstandard headers, but yes this is fine, and fairly common, like the "X-Powered-By" headers ASP.NET and PHP like to use.

drench
Thanks drench, I'll try X-Server-Host instead :)
simonrjones