diff --git a/robotstxt.admin.inc b/robotstxt.admin.inc
index d2a578e..a558e08 100644
--- a/robotstxt.admin.inc
+++ b/robotstxt.admin.inc
@@ -22,3 +22,230 @@ function robotstxt_admin_settings() {
 
   return system_settings_form($form);
 }
+
+/**
+ * Form builder callback
+ *
+ * @param $form
+ * @param $form_state
+ * @return mixed
+ */
+function robotstxt_multisite_settings($form, &$form_state) {
+  // Check root settings
+  // - check main robots.txt file existence
+  // - suggest necessary server updates
+  $form['root'] = array(
+    '#type' => 'fieldset',
+    '#title' => 'Main robots.txt file',
+    '#collapsible' => TRUE,
+    '#collapsed' => FALSE,
+  );
+
+  $fe = file_exists(DRUPAL_ROOT . "/robots.txt");
+  $form['root']['file'] = array(
+    '#type' => 'markup',
+    '#prefix' => '<div class="messages ' . ($fe ? 'status' : 'warning') .  '">',
+    '#markup' => t('System-wide file <b>robots.txt</b> @status', array('@status' => $fe ? "exists." : "does not exist. PLEASE, RESTORE THE FILE!")),
+    '#suffix' => '</div>',
+  );
+
+
+  preg_match('/apache|nginx/i', $_SERVER['SERVER_SOFTWARE'], $matches);
+  $server = !empty($matches[0]) ? strtolower($matches[0]) : FALSE;
+  if ($suggestion = _robotstxt_server_suggestions($server)) {
+    $form['root']['software'] = array(
+      '#type' => 'item',
+      '#prefix' => '<b>',
+      '#title' => t('Web server:'),
+      '#markup' => t('<b>@server</b>', array('@server' => $_SERVER['SERVER_SOFTWARE'])),
+      '#suffix' => '</b>',
+    );
+    $form['root']['suggestion'] = array(
+      '#type' => 'markup',
+      '#prefix' => '<p>',
+      '#markup' => t('In order for multisite setting to work, and to keep the main <b>robots.txt</b> file in place, ' . $suggestion['message'], array('%file' => $suggestion['file'])),
+      '#suffix' => '</p>' . $suggestion['code'],
+    );
+  }
+  else {
+    $form['root']['software'] = array(
+      '#type' => 'markup',
+      '#prefix' => '<div class="messages error">',
+      '#markup' => t('Could not identify server software, or server software is not supported. Only Apache and Nginx are supported.'),
+      '#suffix' => '</div>',
+    );
+  }
+
+  // Build a table
+  $files = _robotstxt_check_markers();
+  $rows = array();
+  $count = 0; $missing = 0;
+  foreach ($files as $alias => $data) {
+    $rows[] = array(
+      'data' => array(
+        array('data' => ($data['original'] ? '' : '--> ' ) .  $alias),
+        array('data' => ($data['original'] ? '' : ($data['sites'] ? 'yes' : 'no')) ),
+        array('data' => $data['file']),
+        array('data' => $data['exists'] ? 'OK' : 'Missing'),
+      ),
+      'no_striping' => TRUE,
+      'class' => $data['exists'] ? (!$data['original'] && !$data['sites'] ? 'warning': 'ok') : 'error',
+    );
+    // Keep track of missing/existing files
+    $count++;
+    $missing += !$data['exists'];
+  }
+
+  $form['markers'] = array(
+    '#theme' => 'table',
+    '#header' => array('Site / folder', 'Aliased', 'Marker file path', 'Status'),
+    '#rows' => $rows,
+  );
+
+  $form['actions'] = array('#type' => 'actions');
+  if ($missing) {
+    $form['actions']['generate'] = array(
+      '#type' => 'submit',
+      '#value' => t('Generate markers'),
+      '#submit' => array('robotstxt_multisite_settings_submit_generate'),
+    );
+  }
+  if ($missing < $count) {
+    $form['actions']['delete'] = array(
+      '#type' => 'submit',
+      '#value' => t('Delete markers'),
+      '#submit' => array('robotstxt_multisite_settings_submit_delete'),
+    );
+  }
+
+  return $form;
+}
+
+/**
+ * Submit callback
+ *
+ * @param $form
+ * @param $form_state
+ */
+function robotstxt_multisite_settings_submit_generate($form, &$form_state) {
+  $markers = _robotstxt_check_markers();
+  foreach ($markers as $data) {
+    if (!$data['exists']) {
+      $path = DRUPAL_ROOT . DIRECTORY_SEPARATOR . $data['file'];
+      if (!touch($path)) {
+        drupal_set_message(t('Could not create file !file', array('!file' => $data['file'])), 'error');
+      }
+    }
+  }
+}
+
+function robotstxt_multisite_settings_submit_delete($form, &$form_state) {
+  $markers = _robotstxt_check_markers();
+  foreach ($markers as $data) {
+    if ($data['exists']) {
+      $path = DRUPAL_ROOT . DIRECTORY_SEPARATOR . $data['file'];
+      if (!unlink($path)) {
+        drupal_set_message(t('Could not delete file !file', array('@file' => $data['file'])));
+      }
+    }
+  }
+}
+
+/**
+ * Generates a list of marker files and checks their existence.
+ *
+ * Marker files are necessary for Apache/Nginx to craft a special request so that the
+ * module could return custom robots.txt file. Each file is associated with the site name,
+ * either original or an alias defined in sites.php.
+ *
+ * @return array Array of marker files data. Each entry contains the following:
+ *   - original: bool, whether this file is placed in the conf folder or is an alias
+ *   - sites: bool, whether this file is created for a alias defined in sites.php
+ *   - file: string, file path relative to the DRUPAL_ROOT
+ *   - exists: bool. whether file exists or not
+ */
+function _robotstxt_check_markers() {
+  global $base_url;
+  $markers = array();
+  // Get aliases
+  $sites = array();
+  if (file_exists(DRUPAL_ROOT . '/sites/sites.php')) {
+    // This will overwrite $sites with the desired mappings.
+    include(DRUPAL_ROOT . '/sites/sites.php');
+  }
+  // Add current conf dir to the aliases array
+  $conf_dir = substr(conf_path(), 6);
+  $host = parse_url($base_url, PHP_URL_HOST);
+
+  $aliases = $sites;
+
+  // add current host is case it was not in recorded in sites.php file
+  if (!isset($sites[$host])) {
+    $aliases = array_merge(array($host => $conf_dir), $sites);
+  }
+
+  // Add 'default' to the list of folders if necessary
+  if ('default' === $conf_dir || $aliases[$host] === $conf_dir) {
+    $aliases = array_merge(array($conf_dir => $conf_dir), $aliases);
+  }
+
+  // Check markers
+  foreach ($aliases as $alias => $dir) {
+    if ($conf_dir === $dir) {
+      $original = in_array($alias, array('default', $conf_dir));
+      $file =  in_array($alias, array('default', $conf_dir)) ? '/.robotstxt' : '.robotstxt';
+      $marker = 'sites/' . $alias . $file;
+      $markers[$alias] = array(
+        'original' => $original,
+        'sites' => isset($sites[$alias]),
+        'file' => $marker,
+        'exists' => file_exists(DRUPAL_ROOT . DIRECTORY_SEPARATOR . $marker),
+      );
+    }
+  }
+  return $markers;
+}
+
+/**
+ * Helper function
+ * Provides suggestions for server configuration changes
+ *
+ * @param string $server Server name in lower case
+ * @return bool|string[] Suggested server data, or FALSE
+ */
+function _robotstxt_server_suggestions($server) {
+  $suggestions = array(
+    'apache' => array(
+      'file' => '.htaccess',
+      'message' => 'the following addition to your %file file is necessary:',
+			'code' => "<pre>
+RewriteCond %{REQUEST_URI} ^/robots.txt$
+RewriteCond %{DOCUMENT_ROOT}/sites/%{HTTP_HOST}/.robotstxt -f [OR]
+RewriteCond %{DOCUMENT_ROOT}/sites/%{SERVER_PORT}.%{HTTP_HOST}.robotstxt -f [OR]
+RewriteCond %{DOCUMENT_ROOT}/sites/%{HTTP_HOST}.robotstxt -f
+RewriteRule ^ index.php?q=robots.txt [L]
+</pre>",
+    ),
+    'nginx' => array(
+      'file' => 'rules',
+      'message' => 'the following update to your %file file is necessary:',
+			'code' => '<pre>
+location = /robots.txt {
+    allow all;
+    log_not_found off;
+    access_log off;
+    if (-f $document_root/sites/$host/.robotstxt) {
+        rewrite ^ /index.php?q=robots.txt;
+    }
+    if (-f $document_root/sites/$host.robotstxt) {
+        rewrite ^ /index.php?q=robots.txt;
+    }
+    if (-f $document_root/sites/$server_port.$host.robotstxt) {
+        rewrite ^ /index.php?q=robots.txt;
+    }
+}
+</pre>',
+    )
+  );
+  return isset($suggestions[$server]) ? $suggestions[$server] : FALSE;
+}
diff --git a/robotstxt.module b/robotstxt.module
index 6e23fd6..61a660f 100644
--- a/robotstxt.module
+++ b/robotstxt.module
@@ -27,6 +27,10 @@ function robotstxt_permission() {
       'title' => t('Administer robots.txt'),
       'description' => t('Perform maintenance tasks for robots.txt.'),
     ),
+    'administer multisite robots.txt' => array(
+      'title' => t('Administer multisite robots.txt'),
+      'description' => t('Perform maintenance tasks for robots.txt in a multisite environment.'),
+    ),
   );
 }
 
@@ -47,6 +51,20 @@ function robotstxt_menu() {
     'access arguments' => array('administer robots.txt'),
     'file' => 'robotstxt.admin.inc',
   );
+  $items['admin/config/search/robotstxt/content'] = array(
+    'title' => 'Content',
+    'description' => 'Manage contents of your robots.txt file.',
+    'type' => MENU_DEFAULT_LOCAL_TASK
+  );
+  $items['admin/config/search/robotstxt/multisite'] = array(
+    'title' => 'Multisite Support',
+    'description' => 'Manage robots.txt file multisite support.',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('robotstxt_multisite_settings'),
+    'access arguments' => array('administer multisite robots.txt'),
+    'file' => 'robotstxt.admin.inc',
+    'type' => MENU_LOCAL_TASK
+  );
 
   return $items;
 }
