Доброго времни суток всем! : )
Вознилка идея убрать категорию из URL новостей, чтобы ссылки превратились из:
site.ru/cat/1-novost.html
в:
site.ru/1-novost.html
Как я понял надо затрагивать файл show.short.php, а именно строку:
if( $row['category'] and $config['seo_type'] == 2 ) {
$full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
.....
И в ней убрать:
. get_url( $row['category'] ) .
1. Правильно ли? Если нет, то где ещё и как?
2. Что добавить в .htaccess, чтобы шёл редирект с
site.ru/cat/1-novost.html на
site.ru/1-novost.htmlИзвините, если что-нибудь непонятно описал. Спасибо.
engineajaxfind_relates.php
$full_link = $config['http_home_url'].get_url($related['category'])."/".$related['id']."-".$related['alt_name'].".html";
engineclassesgoogle.class.php
$loc = $this->home.get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
engineinccmoderation.php
$full_link = $config['http_home_url'].get_url(intval($row['category']))."/".$row['post_id']."-".$row['alt_name'].".html";
engineinceditnews.php
$full_link = $config['http_home_url'].get_url(intval($row['category']))."/".$row['id']."-".$row['alt_name'].".html";
enginemodulesfullsearch.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
enginemoduleslastcomments.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['post_id']."-".$row['alt_name'].".html";
enginemodulessearch.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
enginemodulesshow.custom.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
enginemodulesshow.full.php
$full_link = $config['http_home_url'].get_url($category_id)."/".$row['id']."-".$row['alt_name'].".html";
$print_link = $config['http_home_url'].get_url($category_id)."/print:page,".$news_page.",".$row['id']."-".$row['alt_name'].".html";
$full_link = $config['http_home_url'].get_url($related['category'])."/".$related['id']."-".$related['alt_name'].".html";
enginemodulesshow.short.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
enginemodulestopnews.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
Ещё раз уточню первый вопрос:
1. Правильно ли будет, если я удалю везде
.get_url($row['category']).
То все будет ок? Или надо тестировать?
Спасибо.
Источник:
dle-faq.pro, DLE
💬 Комментарии
В связи с новыми требованиями законодательства РФ (ФЗ-152, ФЗ «О рекламе») и ужесточением контроля со стороны РКН, мы отключили систему комментариев на сайте.
🔒 Важно Теперь мы не собираем и не храним ваши персональные данные — даже если очень захотим.
💡 Хотите обсудить материал?
Присоединяйтесь к нашему Telegram-каналу:
https://t.me/blogssmartzНажмите кнопку ниже — и вы сразу попадёте в чат с комментариями