You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
aliseptik/404.php

239 lines
5.1 KiB

<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/bitrix/modules/main/include/urlrewrite.php');
CHTTP::SetStatus("404 Not Found");
@define("ERROR_404","Y");
const HIDE_SIDEBAR = true;
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/header.php");
$APPLICATION->SetTitle("Страница не найдена");
$APPLICATION->SetPageProperty("description", "Запрашиваемая страница не найдена. Перейдите на главную или воспользуйтесь поиском по сайту.");
// header("HTTP/1.0 404 Not Found");
?>
<style>
.error-404 {
text-align: center;
padding: 60px 20px;
min-height: 500px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.error-404__number {
font-size: 120px;
font-weight: bold;
color: #ff6600;
margin: 0;
line-height: 1;
text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}
.error-404__title {
font-size: 28px;
color: #333;
margin: 20px 0 10px;
font-weight: 600;
}
.error-404__text {
font-size: 16px;
color: #666;
margin: 0 0 40px;
max-width: 500px;
line-height: 1.5;
}
.error-404__actions {
display: flex;
gap: 20px;
flex-wrap: wrap;
justify-content: center;
margin-bottom: 40px;
}
.error-404__btn {
display: inline-block;
padding: 12px 30px;
border-radius: 5px;
text-decoration: none;
font-weight: 500;
transition: all 0.3s ease;
border: none;
cursor: pointer;
font-size: 16px;
}
.error-404__btn--primary {
background-color: #ff6600;
color: white;
}
.error-404__btn--primary:hover {
background-color: #e55a00;
transform: translateY(-2px);
}
.error-404__btn--secondary {
background-color: transparent;
color: #ff6600;
border: 2px solid #ff6600;
}
.error-404__btn--secondary:hover {
background-color: #ff6600;
color: white;
}
.error-404__search {
max-width: 400px;
width: 100%;
margin: 0 auto 40px;
}
.error-404__search-form {
display: flex;
border: 2px solid #ddd;
border-radius: 5px;
overflow: hidden;
}
.error-404__search-input {
flex: 1;
padding: 12px 15px;
border: none;
outline: none;
font-size: 16px;
}
.error-404__search-btn {
background-color: #ff6600;
color: white;
border: none;
padding: 12px 20px;
cursor: pointer;
transition: background-color 0.3s ease;
}
.error-404__search-btn:hover {
background-color: #e55a00;
}
.error-404__links {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 20px;
max-width: 800px;
width: 100%;
margin: 0 auto;
}
.error-404__link-group {
text-align: left;
}
.error-404__link-title {
font-size: 18px;
font-weight: 600;
color: #333;
margin-bottom: 10px;
}
.error-404__link-list {
list-style: none;
padding: 0;
margin: 0;
}
.error-404__link-item {
margin-bottom: 8px;
}
.error-404__link {
color: #666;
text-decoration: none;
transition: color 0.3s ease;
}
.error-404__link:hover {
color: #ff6600;
}
@media (max-width: 768px) {
.error-404__number {
font-size: 80px;
}
.error-404__title {
font-size: 24px;
}
.error-404__actions {
flex-direction: column;
align-items: center;
}
.error-404__btn {
width: 100%;
max-width: 300px;
}
.error-404__links {
grid-template-columns: 1fr;
text-align: center;
}
.error-404__link-group {
text-align: center;
}
}
</style>
<div class="error-404">
<h1 class="error-404__number">404</h1>
<h2 class="error-404__title">Страница не найдена</h2>
<p class="error-404__text">
К сожалению, запрашиваемая страница не существует или была перемещена.
Возможно, вы перешли по устаревшей ссылке или допустили ошибку в адресе.
</p>
<div class="error-404__actions">
<a href="/" class="error-404__btn error-404__btn--primary">На главную</a>
<a href="/catalog/" class="error-404__btn error-404__btn--secondary">Каталог септиков</a>
</div>
</div>
<script>
// Отправка события 404 в Google Analytics (если подключен)
if (typeof gtag !== 'undefined') {
gtag('event', 'page_view', {
'page_title': '404 Not Found',
'page_location': window.location.href
});
}
// Отправка события 404 в Яндекс.Метрику (если подключена)
if (typeof ym !== 'undefined') {
ym(window.yaCounterId, 'hit', window.location.href, {
title: '404 Not Found'
});
}
// Фокус на поле поиска при загрузке
document.addEventListener('DOMContentLoaded', function() {
const searchInput = document.querySelector('.error-404__search-input');
if (searchInput) {
searchInput.focus();
}
});
</script>
<?php require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/footer.php"); ?>