Mostly rewrite missing.php

* Fix the particularly stupid error message given when a client tries to
  access a mobile domain on the main Squid IP address, and possibly also
  in other situations that are our fault, per bug 47807.
* Don't redirect non-existent domains to meta, send a 404. This is also
  partly aimed at addressing bug 47807.
* Fix lack of PATH_INFO validation per fixme comment. Use PATH_INFO for
  the page name instead of REQUEST_URI.
* Remove secure.wikimedia.org support, obsolete.
* Remove use of $_SERVER['HTTPS'], that will never work.
* Replace use of $_SERVER['SERVER_NAME'] with $_SERVER['HTTP_HOST'],
  since they are not the same and the latter was almost certainly
  intended.
* Remove custom port handling, unnecessary.
* Send a body with redirects
* Move everything into functions to avoid accidental use of the global
  scope.

Change-Id: I17989fc4124bcb296e809ba0a13f41c043af7d0d