Сайт joomla выдает ошибку 404

The most common problem with websites which are struggling in search engine rankings is the number of ‘not found’ errors – commonly referred to as 404 errors because that is the status code returned if the page cannot be found.

First, there are legitimate reasons to have 404 errors – if you have a page for an event which has passed, or a service which you no longer provide. In these cases, eventually the page will be removed from the index of search engines and won’t be associated with your site any more.

The problem occurs if you have a lot of 404 errors – for example if you unpublish a category which contained hundreds of articles. From the search engine’s perspective, this is not a great experience for their visitors, because they land on your site and the information that the search engine told them was there, isn’t. This is why it is not a great idea to have too many 404 errors on your site.

The first step is to find out how many you have – which can be done using Google’s Search Central. This is a free set of tools which allows you to analyse your website and pick up on problems, errors and issues quickly. It is recommended that you have every site you manage registered at Search Central to ensure you are notified in the event of any problems.

When you visit Search Central there is a section which shows you URL Errors in the search listing – this will show you a list of the 404 errors that Google has found on your site, and a graph which shows you how this has changed over time. If the graph starts to go up, look into why there are pages that were on your site and now can’t be found.

If there was a temporary problem on your site, you can mark errors as being fixed.

404discovery.png

Fixing Problems[edit]

Discovery is only one part of the process. Once you have discovered the problematic URLs, do something about it (if it needs fixing!) by either redirecting the page to another on the site, re-instating the original page, or looking into what has caused the 404 error.

If you need to redirect a page, check out this page which explains how to create 301 (permanent) redirects: Creating 301 redirects

Monitoring Problems[edit]

If you want to monitor your 404 traffic, the best way to do this in Analytics is to look at what happens when you have a 404 error. In most cases, the page title changes to 404 – so we can create a custom segment which will filter traffic with a title of 404 and tell you what the landing page is. This should allow you to monitor and proactively manage your 404 errors and ensure that your site visitors do not end up landing on dead links.

Analyticsalerts.png

Analyticsalerts2.png

Google also has the ability, in Analytics, to set up alerts. Alerts allow you to be emailed when certain events occur. In this case, we can set up an alert to be notified if there is more than a 5% increase in the number of 404 errors in a weekly period – which might mean we have a problem with the website which needs investigating.

This is a great way to keep on top of things even if you haven’t logged in to look at your dashboard!

Analyticsalertsemail.png

Monitoring Errors with a Dashboard[edit]

There is also a dashboard you can install called the Data Integrity Dashboard which shows you information about 404 errors, along with some other metrics which might be of interest. Just search the Google Analytics Gallery for Data Integrity Dashboard and select which profile to install it under.

Dataintegrity.png

Время на прочтение
2 мин

Количество просмотров 14K

image

Известно, что для того, чтобы удержать посетителя на сайте, нужно правильно обрабатывать HTTP/1.0 404 и другие подобные коды. На просторах интернета можно найти массу занимательных примеров страниц 404, а также руководств – что и как сделать, чтобы ошибка 404 правильно обрабатывалась сайтом как для посетителя, так и для поисковых систем.

Хочу с вами обсудить проблему 404 для сайтов Joomla.

Общие рекомендации по настройке Joomla для обработки HTTP/1.0 404

Не буду повторять здесь все причины тех или иных шагов и настроек, буду перечислять кратко то, что можно найти в Интернете.

  1. Создаем в нашей Joomla «красивую страничку 404». Можно несколько — при реализации вашей особенной логики и способа их выбора для
    посетителя;
  2. В свой шаблон, который используется на сайте в качестве основного шаблона frontend, из системного шаблона system переписываем файл error.php;
  3. Далее редактируем этот файл для того, чтобы следовать следующей логике – если мы отловили ошибку 404 – то сначала выдать заголовок HTTP/1.0 404, а затем выдать страницу, которую мы ранее подготовили. Предположим, номер (ID) нашей «красивой страницы 404» равен 1001. Файл error.php в вашем шаблоне может выглядеть так:

defined('_JEXEC') or die;

if (!isset($this->error))
{
	$this->error = JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR'));
	$this->debug = false;
}

// Get language and direction
$doc             = JFactory::getDocument();
$app             = JFactory::getApplication();
$this->language  = $doc->language;
$this->direction = $doc->direction;

if($this->error->getCode()=='404') {
	header("HTTP/1.0 404 Not Found");
	header('Location: index.php?option=com_content&view=article&id=1001');
}

Теперь проверяем. Вводим адрес сайта. Далее – абракадабра после символа /. Работает? Работает, чего и следовало ожидать.

В чем подвох?

Открываем отладку страниц в вашем любимом браузере (мой любимый браузер – Fitefox с Firebug-ом), вкладка «Сеть», и смотрим заголовки, которыми общается браузер с сайтом.

Вводим адрес сайта – заголовок HTTP/1.0 200 OK

Теперь абракадабра… Ожидаем HTTP/1.0 400 Not Found — смотрим заголовки:

  1. Сначала HTTP/1.0 302 Found
  2. Затем наша красивая страница отдается браузеру с кодом HTTP/1.0 200 OK

image

Чем это плохо?

— Но, ведь, работает? — Скажете вы. Да, работает. А как на это смотрит поисковая система?

Был у меня переезд страниц сайта с одного раздела (папки) сайта на другой. Но переехать должны были не все страницы. Страницы старого раздела сайта были в индексе. Те, что переехали – выдавались с кодом HTTP/1.0 301 Moved Permanently (классика жанра) и поисковики их правильно «переехали» на новое место. А те, что должны были «кануть в лету» – так и мелькали в индексе, хотя физически отсутствовали на сайте, а при обращении к ним выдавалась «красивая страничка 404», но не код HTTP/1.0 404 (смотрим выше).

Выход из этой ситуации

Для страниц с ошибкой 404 я решил выдавать заголовок HTTP/1.0 404 Not Found и делать не редирект через заголовок Location, а читать поток «красивой страницы 404» и перенаправлять его браузеру. Вот реализация:

if($this->error->getCode()=='404') {
	header("HTTP/1.0 404 Not Found");
	$url=JURI::root()."index.php?option=com_content&view=article&id=1001";
	$data = file_get_contents($url) or die("Cannot open URL");
    echo $data; 
}

Теперь, и нужная страница посетителю отдается при ошибке 404, и поисковая машина видет действительно код 404 и считает введенный адрес таковым — Not Found.

Узнайте, как правильно создать и настроить собственную страницу ошибки 404 для сайта на Joomla 3 и Joomla 4, отображаемую в интерфейсе шаблона.

Важно знать!

Ошибка 404 (Error 404) — это ответ сервера, отправляемый при запросах на несуществующие ресурсы.

Веб-сервер должен отправлять ответ 404 Not Found в случае, если соответствующего запрашиваемому URL-адресу ресурса не существует.

Что такое страница ошибки 404?

Важно знать!

Страница ошибки 404 — это веб-страница, отображаемая при прямом запросе на несуществующий документ.

При этом сервер должен отдавать именно ответ 404 Not Found, а не перенаправлять пользователей на страницу со статусом 200 OK. Это очень важно, т. к. роботы поисковых систем принимают во внимание ответы сервера, и считают существующими все страницы со статусом 200 OK, который не запрещает индексировать такие страницы в поисковой системе, а это может способствовать появлению дублей страниц в поисковой выдаче и затруднит продвижение сайта в целом.

Страница ошибки 404 в шаблонах Joomla

Профессиональные шаблоны Joomla всегда имеют в своём арсенале настроенную рабочую страницу 404-й ошибки, отображаемую при вводе несуществующих адресов.

Как правило, внешний интерфейс данных страниц сильно отличается от общего интерфейса шаблона, что может негативно сказаться на поведенческих факторах: некоторые пользователи могут «испугаться» и покинуть сайт. Во избежание таких потерь посетителей сайта на ровном месте мы рекомендуем создавать настраиваемую страницу для 404-ошибки, отображаемую в интерфейсе шаблона.

Создание страницы 404 в интерфейсе шаблона

Разберем по пунктам, как правильно создать и настроить собственную страницу ошибки 404 в теле стандартного шаблона Protostar для Joomla 3 с отображением контента в области компонента.

Важно знать!

Указанная инструкция актуальна как для Joomla 3, так и для Joomla 4.

  1. Создать и опубликовать материал, который будет отображаться при запросе несуществующей страницы. Примеры опций:
    • Заголовок: «Страница не найдена».
    • Алиас: «error-404».
    • Cодержание: «Указанной страницы не существует. Вероятно, она была удалена или перенесена на другой адрес.»
    • Категория: «Uncategorised».
  2. Создать и опубликовать скрытый пункт меню данного материала с алиасом error-404:
    • Во вкладке Параметры материала необходимо отключить показ всей лишней информации (Автор, Хиты, Дата публикации и т. д.).
    • Во вкладке Параметры ссылки необходимо установить опцию Показать в меню на Нет, чтобы скрыть пункт меню.
    • Во вкладке Параметры страницы можно прописать тег <title>, который будет отображаться вместо названия материала. Например: «Ошибка 404 — страница не найдена».
    • Во вкладке Метаданные выбрать значение метатега Robots noindex, nofollow.
  3. В папке шаблона (/templates/шаблон) создать или заменить существующий файл error.php, который должен содержать только следующий код:
    <?php
    defined( '_JEXEC' ) or die( 'Restricted access' );
    if($this->error->getCode() == '404'){
        header("HTTP/1.1 404 Not Found");
        echo file_get_contents(JURI::root().'error-404');
        exit;
    }
  4. Проверяем функционирование страницы. По запросу несуществующего документа должен отображаться созданный материал.
  5. Проверяем ответ сервера для несуществующей страницы. Для этого можно воспользоваться панелью разработчика в браузере или сторонним веб-сервисом.
  6. Чтобы сделать страницу ошибки 404 более наглядной, рекомендуем добавить в её контент соответствующее изображение, которое без труда можно найти в поисковой выдаче картинок, а также отключить на ней ненужные модули.

Видеоинструкция

0 Пользователей и 1 Гость просматривают эту тему.

  • 3 Ответов
  • 3571 Просмотров

Сабж: http://obstanovka-nn.ru
При обновлении главной или при переходе на главную вылазит ошибка 404. С чем это может быть связано?

Посмотрите что написано в менеджере меню—> пункт «главная» —> и обратите внимание на вкладку «Параметры отображения страницы»  

Или если выводится статья, посмотреть как она называется

Записан

Лучшее спасибо это «+» в карму

Посмотрите что написано в менеджере меню—> пункт «главная» —> и обратите внимание на вкладку «Параметры отображения страницы»  

Или если выводится статья, посмотреть как она называется

Спасибо, помогло!

Жмякнул в карму:)

Всем привет.
Ребят, почти такая же проблема, но советом N2uM воспользоваться не могу, не увидел причины проблемы у себя.
При запуске сайта с установленным sh404SEF главная выводится нормально.
 НО! Когда с других страниц пытаешься перейти на главную (верхнее меню) — вылазит дополнительная
ссылка в адресной строке, цитирую: http://klinika-v.ru/http:/klinika-v.ru
И соответственно получается необработанная ошибка 404.
Подскажите, как поправить?
Ссылки на сканы страниц:
http://yadi.sk/d/zVXuzBD3M2U9Y
http://yadi.sk/d/LCN6k8IaM2UFi

If someone visits a page that does not exist, then a server will return a 404 not found error. Broken links may have very bad impact on your website’s reputation, frustrate your visitors and result in smaller number of visits. That is why it is so important to avoid 404 error pages as much as possible.

Of course not all 404 errors messages on Joomla site are bad. If you have deleted an article or product because it was no longer relevant on your website, then 404 error for such content is fine. Google will simply remove that page from the search results after some time.

The things are different when 404 page not found error occurs for a content that is still present on your website but under a different URL address. This may happen, for example, when you update the article alias or category.

How to find 404 pages and broken links on a website?

There are many ways to determine the broken links on your website. Let’s take a look on how to find them using Google Search Console and Joomla’s Redirects Component.

Google Search Console

Google Search Console is a free web service that helps you monitor and maintain your website’s presence in Google Search results. It is a must have tool for each owner of a website. If it is your first contact with this tool, read more on how to get your site working on Search Console.

To find all issues that Google bots encountered during crawling of your website, you need to navigate to «Crawl -> Crawl Errors»:

404 Error Message on Joomla

Under the graph you will find a list of pages with errors. If you click on any of the items, you will get more information about the error page and where it was linked from:

Find and repair broken links

Joomla Redirects Component

Also Joomla gives us a possibility to manage 404 pages. Redirects component was introduced in Joomla 1.6 and it can be very useful, especially for small websites.

To see a list of of 404 pages go to «Components -> Redirects»:

Find and repair broken links

NOTE: Make sure you have enabled the «System — Redirect» plugin in «Extensions -> Plugins», otherwise the Redirects component will not collect any URL.

How to fix 404 pages and broken links on a website?

Once you have a list of broken links on your website you can proceed to fix them. The broken links you can repair by redirecting them to working pages.

Repair broken links using Joomla Redirects component

Let’s get back to the Joomla’s Redirects component. Beside the fact, the tool is collecting the broken links, it also allows to repair them. If you click on any broken URL from the list you will see this page:

Joomla redirects component

  1. The broken URL address
  2. The new URL address. The broken URL will be redirected to this one.
  3. Make sure the status is «Enabled»
  4. Click on «Save & Close»

301 redirect for broken links in .htaccess

Another way to repair a broken link is to make a 301 redirect in the .htaccess file.
To redirect a single URL you can add the following rule:

RewriteRule ^old-page$ /new-page [R=301,L]

This rule will simply redirect the old page:
http://www.your-domain.com/old-page
To the new page:
http://www.your-domain.com/new-page

To redirect all pages from old category to another, you can use the following rule:

RewriteRule ^old-category/(.*)$ /new-category/$1 [R=301,L]

This rule will redirect all pages from old category, like:
http://www.your-domain.com/old-category/some-article
http://www.your-domain.com/old-category/another-article
To the new category:
http://www.your-domain.com/new-category/some-article
http://www.your-domain.com/new-category/another-article

NOTE: Make sure you have the «URL Rewriting» option enabled in «System -> Global Configuration». Along with this option you need to rename the htaccess.txt file to .htaccess otherwise the redirect rule will not work.

Mark broken links as fixed in Google Search Console

Once you repair broken links, you can mark them as fixed in Google Search Console. This way you will remove these pages from the list.

Broken Links on Joomla site

If the broken link was not fixed, it will appear back on the list once Google crawl it.

  • Сам он втайне сознавал что совершает ошибку
  • Сай 2 ошибка недостаточно памяти
  • Самарский котел коды ошибок
  • Сайт на проверку речевых ошибок
  • Салют работа над ошибками