This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");?> | |
<? | |
define("NO_KEEP_STATISTIC", true); | |
define("NOT_CHECK_PERMISSIONS", true); | |
use Bitrix\Main\Application; | |
use Bitrix\Main\Loader; | |
$request = Application::getInstance()->getContext()->getRequest(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
ini_set('display_errors', 1); | |
ini_set('display_startup_errors', 1); | |
error_reporting(E_ALL); | |
$redirects = array(); | |
$file = file(__DIR__ . DIRECTORY_SEPARATOR . 'redirect.txt'); | |
foreach ($file as $row) { |
- Редирект HTTP → HTTPS
- Редирект HTTPS → HTTP
- Редирект с www → БЕЗ WWW
- Редирект без www → С WWW
- 301 редирект с одного домена на другой
- Редирект "без слеш" на "со слешем" в Битрикс
- Убираем повторяющиеся слеши в конце URL
- Добавляем слеш, если его нет, и это не файл
- Добавляем слэш в конец URL
- Убираем слеши в конце URL для статических файлов (содержит точку)
> ls # выводит список содержимого текущей директории
> ls -l # более подробная инфа
> ls -a # включая скрытые
> ls -t # сортировка по времени
> ls -lat
> ls 'Calibre Library' или ls Calibre\ Library
> ls Documents Music # содержимое каждой папки
> ls -hF -1 --sort=extension # показать содержимое папки «красиво, в один столбец»
Здравствуйте, сегодня мы рассмотрим обработку адресов в системе управления сайтом 1С-Битрикс. Обработка адресов UrlRewrite применяется для того, чтобы скрипт мог отвечать не только по своему физическому, но и по любому другому указанному адресу. Другими словами, urlrewrite позволяет создавать ЧПУ.
$arUrlRewrite = array(
array(
"CONDITION" => "#^/blog/post/([a-zA-Z0-9\\.\\-_]+)/?.*#",
"RULE" => "ELEMENT_CODE=$1",
"PATH" => "/blog/post.php",
),
array(
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$curPage = $APPLICATION->GetCurPage(true); | |
if (substr_count($curPage, "catalog")) { | |
//Разрешаем индексацию канонических разделов по URL шаблонам | |
$indexPatterns = array( | |
"catalog/ulysse", | |
// ... | |
"catalog/seiko"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
/** | |
* Работа с DOM-деревом через нативный DOMDocument. | |
*/ | |
AddEventHandler("main", "OnEndBufferContent", "FillEmptyAltTags"); | |
function FillEmptyAltTags(&$content) | |
{ | |
global $APPLICATION; |