robots.php 520 B

123456789101112131415161718
  1. <?php
  2. /**
  3. * Set robots.txt
  4. */
  5. if ('/' !== parse_url(elgg_get_site_url(), PHP_URL_PATH)) {
  6. $warning = elgg_echo('admin:robots.txt:subdir');
  7. echo "<div class=\"elgg-admin-notices\"><p>$warning</p></div>";
  8. }
  9. if (file_exists(elgg_get_root_path() . 'robots.txt')) {
  10. // a physical robots.txt exists, which will take precedent over the any configuration
  11. $warning = elgg_echo('admin:robots.txt:physical');
  12. echo "<div class=\"elgg-admin-notices\"><p>$warning</p></div>";
  13. }
  14. echo elgg_view_form('admin/site/set_robots');