In a multisite environment, there is no mechanism for having a separate robots.txt file for each site. This module addresses that need by letting you administer the robots.txt file from the settings interface.

'); break; } return $output; } /** * Loads the robots.txt file found in the robotstxt directory. * This is only done once, if the robotstxt variable is not stored yet. */ function robotstxt_init() { if(!$robots = variable_get('robotstxt', FALSE)) { variable_set('robotstxt', check_plain(file_get_contents((drupal_get_path('module', 'robotstxt'). '/robots.txt')))); } } /** * Defines the robots.txt path as a callback. */ function robotstxt_menu($maycache) { $items = array(); if ($maycache) { $items[] = array( 'path' => 'robots.txt', 'access' => TRUE, 'callback' => 'robotstxt_robots', 'type' => MENU_CALLBACK, 'title' => 'robots.txt' ); } return $items; } /** * You can edit the robots.txt for your site under admin/settings/robotstxt */ function robotstxt_settings() { return form_textarea(t('Value for robots.txt'), 'robotstxt', variable_get('robotstxt', $robotstxt), 60, 20, '', '', FALSE); } /** * Serve up the robots.txt file stored in the db. */ function robotstxt_robots() { print check_plain(variable_get('robotstxt', '')); }