diff -Naur a/vendor/magento/module-config/Model/Config/Backend/Admin/Robots.php b/vendor/magento/module-config/Model/Config/Backend/Admin/Robots.php
--- a/vendor/magento/module-config/Model/Config/Backend/Admin/Robots.php
+++ b/vendor/magento/module-config/Model/Config/Backend/Admin/Robots.php
@@ -44,7 +44,7 @@
         array $data = []
     ) {
         parent::__construct($context, $registry, $config, $cacheTypeList, $resource, $resourceCollection, $data);
-        $this->_directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
+        $this->_directory = $filesystem->getDirectoryWrite(DirectoryList::MEDIA);
         $this->_file = 'robots.txt';
     }
 
diff -Naur a/vendor/magento/module-config/Model/Config/Reader/Source/Deployed/DocumentRoot.php b/vendor/magento/module-config/Model/Config/Reader/Source/Deployed/DocumentRoot.php
new file mode 100644
--- /dev/null
+++ b/vendor/magento/module-config/Model/Config/Reader/Source/Deployed/DocumentRoot.php
@@ -0,0 +1,55 @@
+<?php
+/**
+ * Copyright © Magento, Inc. All rights reserved.
+ * See COPYING.txt for license details.
+ */
+
+namespace Magento\Config\Model\Config\Reader\Source\Deployed;
+
+use Magento\Framework\Config\ConfigOptionsListConstants;
+use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Framework\App\DeploymentConfig;
+
+/**
+ * Class DocumentRoot
+ * @package Magento\Config\Model\Config\Reader\Source\Deployed
+ */
+class DocumentRoot
+{
+    /**
+     * @var DeploymentConfig
+     */
+    private $config;
+
+    /**
+     * DocumentRoot constructor.
+     * @param DeploymentConfig $config
+     */
+    public function __construct(DeploymentConfig $config)
+    {
+        $this->config = $config;
+    }
+
+    /**
+     * A shortcut to load the document root path from the DirectoryList based on the
+     * deployment configuration.
+     *
+     * @return string
+     */
+    public function getPath()
+    {
+        return $this->isPub() ? DirectoryList::PUB : DirectoryList::ROOT;
+    }
+
+    /**
+     * Returns whether the deployment configuration specifies that the document root is
+     * in the pub/ folder. This affects ares such as sitemaps and robots.txt (and will
+     * likely be extended to control other areas).
+     *
+     * @return bool
+     */
+    public function isPub()
+    {
+        return (bool)$this->config->get(ConfigOptionsListConstants::CONFIG_PATH_DOCUMENT_ROOT_IS_PUB);
+    }
+}
diff -Naur a/vendor/magento/module-sitemap/Block/Adminhtml/Grid/Renderer/Link.php b/vendor/magento/module-sitemap/Block/Adminhtml/Grid/Renderer/Link.php
--- a/vendor/magento/module-sitemap/Block/Adminhtml/Grid/Renderer/Link.php
+++ b/vendor/magento/module-sitemap/Block/Adminhtml/Grid/Renderer/Link.php
@@ -11,6 +11,8 @@
 namespace Magento\Sitemap\Block\Adminhtml\Grid\Renderer;
 
 use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot;
+use Magento\Framework\App\ObjectManager;
 
 class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer
 {
@@ -25,19 +27,28 @@ class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRe
     protected $_sitemapFactory;
 
     /**
+     * @var DocumentRoot
+     */
+    protected $documentRoot;
+
+    /**
      * @param \Magento\Backend\Block\Context $context
      * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory
      * @param \Magento\Framework\Filesystem $filesystem
      * @param array $data
+     * @param DocumentRoot $documentRoot
      */
     public function __construct(
         \Magento\Backend\Block\Context $context,
         \Magento\Sitemap\Model\SitemapFactory $sitemapFactory,
         \Magento\Framework\Filesystem $filesystem,
-        array $data = []
+        array $data = [],
+        DocumentRoot $documentRoot = null
     ) {
         $this->_sitemapFactory = $sitemapFactory;
         $this->_filesystem = $filesystem;
+        $this->documentRoot = $documentRoot ?: ObjectManager::getInstance()->get(DocumentRoot::class);
+
         parent::__construct($context, $data);
     }
 
@@ -54,7 +65,8 @@ class Link extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRe
         $url = $this->escapeHtml($sitemap->getSitemapUrl($row->getSitemapPath(), $row->getSitemapFilename()));
 
         $fileName = preg_replace('/^\//', '', $row->getSitemapPath() . $row->getSitemapFilename());
-        $directory = $this->_filesystem->getDirectoryRead(DirectoryList::ROOT);
+        $documentRootPath = $this->documentRoot->getPath();
+        $directory = $this->_filesystem->getDirectoryRead($documentRootPath);
         if ($directory->isFile($fileName)) {
             return sprintf('<a href="%1$s">%1$s</a>', $url);
         }
diff -Naur a/vendor/magento/module-sitemap/Model/Sitemap.php b/vendor/magento/module-sitemap/Model/Sitemap.php
--- a/vendor/magento/module-sitemap/Model/Sitemap.php
+++ b/vendor/magento/module-sitemap/Model/Sitemap.php
@@ -8,7 +8,8 @@
 
 namespace Magento\Sitemap\Model;
 
-use Magento\Framework\App\Filesystem\DirectoryList;
+use Magento\Config\Model\Config\Reader\Source\Deployed\DocumentRoot;
+use Magento\Framework\App\ObjectManager;
 
 /**
  * Sitemap model
@@ -179,11 +180,13 @@ class Sitemap extends \Magento\Framework\Model\AbstractModel
         \Magento\Framework\Stdlib\DateTime $dateTime,
         \Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
         \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
-        array $data = []
+        array $data = [],
+        DocumentRoot $documentRoot = null
     ) {
         $this->_escaper = $escaper;
         $this->_sitemapData = $sitemapData;
-        $this->_directory = $filesystem->getDirectoryWrite(DirectoryList::ROOT);
+        $documentRoot = $documentRoot ?: ObjectManager::getInstance()->get(DocumentRoot::class);
+        $this->_directory = $filesystem->getDirectoryWrite($documentRoot->getPath());
         $this->_categoryFactory = $categoryFactory;
         $this->_productFactory = $productFactory;
         $this->_cmsFactory = $cmsFactory;
diff -Naur a/vendor/magento/framework/Config/ConfigOptionsListConstants.php b/vendor/magento/framework/Config/ConfigOptionsListConstants.php
--- a/vendor/magento/framework/Config/ConfigOptionsListConstants.php
+++ b/vendor/magento/framework/Config/ConfigOptionsListConstants.php
@@ -30,6 +30,8 @@ class ConfigOptionsListConstants
     const CONFIG_PATH_DB = 'db';
     const CONFIG_PATH_RESOURCE = 'resource';
     const CONFIG_PATH_CACHE_TYPES = 'cache_types';
+    const CONFIG_PATH_DOCUMENT_ROOT_IS_PUB = 'directories/document_root_is_pub';
+
     /**#@-*/
 
     /**#@+
