host-meta.php 611 B

1234567891011121314151617
  1. <?php
  2. if($_SERVER['SCRIPT_NAME'] == '/.well-known/host-meta.php') {
  3. header("Access-Control-Allow-Origin: *");
  4. } else {
  5. header('Please-first: activate');
  6. }
  7. header("Content-Type: application/xml+xrd");
  8. echo "<";
  9. ?>
  10. ?xml version="1.0" encoding="UTF-8"?>
  11. <XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0" xmlns:hm="http://host-meta.net/xrd/1.0">
  12. <hm:Host xmlns="http://host-meta.net/xrd/1.0"><?php echo $_SERVER['SERVER_NAME'] ?></hm:Host>
  13. <Link rel="lrdd" template="http<?php echo ($_SERVER['HTTPS']?'s':''); ?>://<?php echo $_SERVER['SERVER_NAME'] ?>/.well-known/webfinger.php?q={uri}">
  14. </Link>
  15. </XRD>