Skip to content
This repository has been archived by the owner on Feb 29, 2020. It is now read-only.

404 при индексировании облака тегов #1

Open
pafnuty opened this issue Sep 24, 2014 · 0 comments
Open

404 при индексировании облака тегов #1

pafnuty opened this issue Sep 24, 2014 · 0 comments

Comments

@pafnuty
Copy link
Member

pafnuty commented Sep 24, 2014

Для исправления косяка с 404 ошибкой при индексировании открываем /engine/engine.php
Ищем:

$tag = urldecode ( $_GET['tag'] );

Ниже вставляем:

/** 
 * Фикс облака тегов по старым ссылкам
 * @author ПафНутиЙ <pafnuty10@gmail.com>
 * @link http://git.io/qE7Lcw DLE-Charset-Converter
 */
if (detect_encoding($tag) == 'windows-1251') {
    $tag = iconv( 'windows-1251', 'UTF-8//IGNORE', $tag );
    $tag = str_replace(' ', '+', $tag);

    header('HTTP/1.0 301 Moved Permanently');
    header('Location: /tags/' . $tag . '/');
    die('Redirect');
}
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant