Как реализовать на DLE ссылки без .html

M0
На сайте с 27.12.2008
Offline
29
1865

Возникла такая ситуация...

Сайт находиться на джумле, но принял решение перенести на DLE.

На джумле все ссылки типа

сайт.ру/категория/id-новость

а при переносе на DLE и включении ЧПУ ссылки имеют такой вид

сайт.ру/категория/id-новость.html

Покопавшись в инете нашел решение под DLE 7.0.... но у меня 8.5

вроде все сделал так как описано, и ссылку в краткой новости оно пишет правильно, но при переходе в полную говорит что мол новость не найдена....

ручками добиваю в адресной строке .html и новость находит.

Вот код который вбивал



Сделать замену

\engine\ajax\find_relates.php
$full_link = $config['http_home_url'].get_url($related['category'])."/".$related['id']."-".$related['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($related['category'])."/".$related['id']."/";



\engine\classes\google.class.php
$loc = $this->home.get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
на
$loc = $this->home.get_url($row['category'])."/".$row['id']."/";



\engine\inc\cmoderation.php
$full_link = $config['http_home_url'].get_url(intval($row['category']))."/".$row['post_id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url(intval($row['category']))."/".$row['post_id']."/";



\engine\inc\editnews.php
$full_link = $config['http_home_url'].get_url(intval($row['category']))."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url(intval($row['category']))."/".$row['id']."/";



\engine\modules\fullsearch.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."/";



\engine\modules\lastcomments.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['post_id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['post_id']."/";



\engine\modules\search.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."/";



\engine\modules\show.custom.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."/";



\engine\modules\show.full.php
$full_link = $config['http_home_url'].get_url($category_id)."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($category_id)."/".$row['id']."/";

$print_link = $config['http_home_url'].get_url($category_id)."/print:page,".$news_page.",".$row['id']."-".$row['alt_name'].".html";
на
$print_link = $config['http_home_url'].get_url($category_id)."/print:page,".$news_page.",".$row['id']."/";

$full_link = $config['http_home_url'].get_url($related['category'])."/".$related['id']."-".$related['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($related['category'])."/".$related['id']."/";



\engine\modules\show.short.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."/";



\engine\modules\topnews.php
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."-".$row['alt_name'].".html";
на
$full_link = $config['http_home_url'].get_url($row['category'])."/".$row['id']."/";


это в 7.0, в поздних версиях наверное тоже самое

ещё в .htaccess нужно дописать
RewriteRule ^([^.]+)/([0-9]+)/(/?)+$ index.php?newsid=$2 [L]

madrom007 добавил 13.04.2010 в 15:13

Вопрос решен

нужно было заменить

RewriteRule ^([^.]+)/([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2 [L]

на

RewriteRule ^([^.]+)/([0-9]+)-(.*)(/?)+$ index.php?newsid=$2 [L]

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий