Skip to content

armgit / Vvveb

Public Imported from GitHub
0

Powerful and easy to use cms to build websites, blogs or ecommerce stores.

Set sitemap paths to match website path

givanz00443692939e
diff --git a/app/controller/feed/robots.php b/app/controller/feed/robots.php
index a77647e..571911f 100644
--- a/app/controller/feed/robots.php
+++ b/app/controller/feed/robots.php
@@ -33,11 +33,13 @@ class Robots extends Base {
$text = @file_get_contents($robots);
}
- $host = ' https://' . $_SERVER['HTTP_HOST'] ?? '' . (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : '');
+ $path = (V_SUBDIR_INSTALL ? V_SUBDIR_INSTALL : '') . ($this->global['path'] ? $this->global['path'] : '');
+ $host = 'https://' . ($_SERVER['HTTP_HOST'] ?? '') . $path;
// change sitemap urls to absolute
- if ($host) {
+ if ($path) {
$text = preg_replace('@(sitemap):\s+/@', "$1: $host/", $text);
+ $text = preg_replace('@(disallow):\s+/@', "$1: $path/", $text);
}
$this->response->setType('text');