host-meta.php 422 B

123456789101112
  1. <?php
  2. $hostMetaHeader = array(
  3. 'Access-Control-Allow-Origin' => '*',
  4. 'Content-Type' => 'application/xrd+json'
  5. );
  6. $serverName = $_SERVER['SERVER_NAME'];
  7. $hostMetaContents = '{"links":[{"rel":"lrdd","template":"http'.(isset($_SERVER['HTTPS'])?'s':'').'://'.$serverName.'/public.php?service=webfinger&q={uri}"}]}';
  8. foreach($hostMetaHeader as $header => $value) {
  9. header($header . ": " . $value);
  10. }
  11. echo $hostMetaContents;