1. Приветствуем Вас на неофициальном форуме технической поддержки XenForo на русском языке. XenForo - коммерческий форумный движок от бывших создателей vBulletin, написанный на PHP.

Оптимизация перед регистрацией в поисковиках

Тема в разделе "Оптимизация XenForo", создана пользователем sergey1985, 16.02.2016.

Загрузка
  1. sergey1985

    sergey1985 Новичок

    Регистрация:
    14.01.16
    Сообщения:
    13
    Симпатии:
    0
    Версия XF:
    1.5.5
    Помогите оптимизировать правильно весь измучался
    Мой robots.txt
    robots.txt
    User-agent: Yandex
    Disallow: /account/
    Disallow: /admin.php
    Disallow: /attachments/
    Disallow: /css.php
    Disallow: /conversations/
    Disallow: /find-new/
    Disallow: /forums/*/?direction
    Disallow: /forums/*/?order
    Disallow: /js/
    Disallow: /help/
    Disallow: /login/
    Disallow: /login.php
    Disallow: /logout/
    Disallow: /lost-password/
    Disallow: /members/
    Disallow: /moderation-queue/
    Disallow: /misc/
    Disallow: /online/
    Disallow: /posts/
    Disallow: /recent-activity/
    Disallow: /search/
    Disallow: /search.php
    Disallow: /threads/*/poll
    Disallow: /threads/*/reply
    Disallow: /watched/

    Host:bizon.ml

    Sitemap: http://bizon.ml/sitemap.php

    А сам sitemap.php в корне сайта

    <?php

    $startTime = microtime(true);
    $fileDir = dirname(__FILE__);

    require($fileDir . '/library/XenForo/Autoloader.php');
    XenForo_Autoloader::getInstance()->setupAutoloader($fileDir . '/library');

    XenForo_Application::initialize($fileDir . '/library', $fileDir);
    XenForo_Application::set('page_start_time', $startTime);

    $dependencies = new XenForo_Dependencies_Public();
    $dependencies->preLoadData();

    /** @var XenForo_Model_Sitemap $sitemapModel */
    $sitemapModel = XenForo_Model::create('XenForo_Model_Sitemap');
    $sitemap = $sitemapModel->getCurrentSitemap();
    if (!$sitemap)
    {
    header('Content-Type: text/plain; charset=utf-8', true, 404);
    echo 'no sitemap';
    exit;
    }

    $counter = isset($_GET['c']) && is_string($_GET['c']) ? intval($_GET['c']) : null;

    if (!$counter)
    {
    if ($sitemap['file_count'] > 1)
    {
    header('Content-Type: application/xml; charset=utf-8');
    header('Content-Disposition: inline; filename="sitemap-index.xml"');
    echo $sitemapModel->buildSitemapIndex($sitemap);
    exit;
    }

    $counter = 1;
    }

    $fileName = $sitemapModel->getSitemapFileName($sitemap['sitemap_id'], $counter, $sitemap['is_compressed']);
    if (file_exists($fileName))
    {
    if ($sitemap['is_compressed'])
    {
    header('Content-Type: application/gzip; charset=utf-8');
    header('Content-Disposition: attachment; filename="sitemap-' . $counter . '.xml.gz"');
    }
    else
    {
    header('Content-Type: application/xml; charset=utf-8');
    header('Content-Disposition: inline; filename="sitemap-' . $counter . '.xml"');
    }

    readfile($fileName);
    }
    else
    {
    header('Content-Type: text/plain; charset=utf-8', true, 404);
    echo 'invalid sitemap file';
    }
     
  2. Aksim

    Aksim Местный

    Регистрация:
    15.09.12
    Сообщения:
    312
    Симпатии:
    89
    Все это тысячи раз обсуждалось, сложно поиском пользоваться?
    Первый вариант который обязан прийти в голову любому админу это посмотреть тотже robots.txt На этом файле. http://www.xf-russia.ru/robots.txt что здесь сложного?
    На форуме даже целый раздел есть http://www.xf-russia.ru/forum/threads/sostavljaem-pravilnyj-robots-txt.167/
    и http://www.xf-russia.ru/forum/forums/optimizacija-xenforo.29/, но это же нужно искать....
     
    shandrigos и Slai нравится это.

Поделиться этой страницей