// Pages excluded for GoogleBot must be for everyone #PSCFV-3674
This commit is contained in:
1 parent
2a297990a0
commit
61f506f398
1 file changed
+27
-22
@@ -365,36 +365,41 @@ class AdminMetaControllerCore extends AdminController
|
|||||||
fwrite($write_fd, "# For more information about the robots.txt standard, see:\n");
|
fwrite($write_fd, "# For more information about the robots.txt standard, see:\n");
|
||||||
fwrite($write_fd, "# http://www.robotstxt.org/wc/robots.html\n");
|
fwrite($write_fd, "# http://www.robotstxt.org/wc/robots.html\n");
|
||||||
|
|
||||||
//GoogleBot specific
|
|
||||||
fwrite($write_fd, "# GoogleBot specific\n");
|
|
||||||
fwrite($write_fd, "User-agent: Googlebot\n");
|
|
||||||
foreach ($this->rb_data['GB'] as $gb)
|
|
||||||
fwrite($write_fd, 'Disallow: '.__PS_BASE_URI__.$gb."\n");
|
|
||||||
|
|
||||||
// User-Agent
|
// User-Agent
|
||||||
fwrite($write_fd, "# All bots\n");
|
|
||||||
fwrite($write_fd, "User-agent: *\n");
|
fwrite($write_fd, "User-agent: *\n");
|
||||||
|
|
||||||
|
// Private pages
|
||||||
|
if (count($this->rb_data['GB']))
|
||||||
|
{
|
||||||
|
fwrite($write_fd, "# Private pages\n");
|
||||||
|
foreach ($this->rb_data['GB'] as $gb)
|
||||||
|
fwrite($write_fd, 'Disallow: '.__PS_BASE_URI__.$gb."\n");
|
||||||
|
}
|
||||||
|
|
||||||
// Directories
|
// Directories
|
||||||
fwrite($write_fd, "# Directories\n");
|
if (count($this->rb_data['Directories']))
|
||||||
foreach ($this->rb_data['Directories'] as $dir)
|
{
|
||||||
fwrite($write_fd, 'Disallow: '.__PS_BASE_URI__.$dir."\n");
|
fwrite($write_fd, "# Directories\n");
|
||||||
|
foreach ($this->rb_data['Directories'] as $dir)
|
||||||
|
fwrite($write_fd, 'Disallow: '.__PS_BASE_URI__.$dir."\n");
|
||||||
|
}
|
||||||
|
|
||||||
// Files
|
// Files
|
||||||
fwrite($write_fd, "# Files\n");
|
if (count($this->rb_data['Files']))
|
||||||
foreach ($this->rb_data['Files'] as $iso_code => $files)
|
{
|
||||||
foreach ($files as $file)
|
fwrite($write_fd, "# Files\n");
|
||||||
fwrite($write_fd, 'Disallow: '.__PS_BASE_URI__.$iso_code.'/'.$file."\n");
|
foreach ($this->rb_data['Files'] as $iso_code => $files)
|
||||||
|
foreach ($files as $file)
|
||||||
|
fwrite($write_fd, 'Disallow: '.__PS_BASE_URI__.$iso_code.'/'.$file."\n");
|
||||||
|
}
|
||||||
|
|
||||||
// Sitemap
|
// Sitemap
|
||||||
fwrite($write_fd, "# Sitemap\n");
|
if (file_exists($this->sm_file) && filesize($this->sm_file))
|
||||||
if (file_exists($this->sm_file))
|
{
|
||||||
if (filesize($this->sm_file))
|
fwrite($write_fd, "# Sitemap\n");
|
||||||
fwrite(
|
fwrite($write_fd, 'Sitemap: '.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].__PS_BASE_URI__.'sitemap.xml'."\n");
|
||||||
$write_fd,
|
}
|
||||||
'Sitemap: '.(Configuration::get('PS_SSL_ENABLED') ? 'https://' : 'http://').$_SERVER['SERVER_NAME'].__PS_BASE_URI__.'sitemap.xml'."\n"
|
|
||||||
);
|
|
||||||
fwrite($write_fd, "\n");
|
|
||||||
fclose($write_fd);
|
fclose($write_fd);
|
||||||
|
|
||||||
$this->redirect_after = self::$currentIndex.'&conf=4&token='.$this->token;
|
$this->redirect_after = self::$currentIndex.'&conf=4&token='.$this->token;
|
||||||
|
|||||||
Reference in new issue
Block a user