Answer the question
In order to leave comments, you need to log in
How to set up the DLE CNC correctly?
Good evening! DLE version 10.6. The problem is this: I removed the ID from the news links, but when I go to this page, the main page opens for some reason, example: Link
I did:
[code]
How to remove the publication ID from the news URL:
1. Open the /engine/engine.php file and look for code:
// ################ Full news #################
if ($subaction != '' or $newsid ) {
if (! $newsid) $sql_news = "SELECT * FROM " . PREFIX. "_post LEFT JOIN " . PREFIX. "_post_extras ON (" . PREFIX . "_post.id=" . PREFIX . "_post_extras.news_id) WHERE alt_name ='$news_name' AND date >= '{$year}-{$month}-{$day}' AND date < '{$year}-{$month}-{$day}' + INTERVAL 24 HOUR LIMIT 1";
else $sql_news = "SELECT * FROM " . PREFIX. "_post LEFT JOIN " . PREFIX. "_post_extras ON (" . PREFIX . "_post.id=" . PREFIX . "_post_extras.news_id) WHERE id = '{$newsid}'";
if ($subaction == '') $subaction = "showfull";
}
replace with:
if (! $_GET['newsid']) $sql_news = "SELECT * FROM " . PREFIX. "_post LEFT JOIN " . PREFIX. "_post_extras ON (" . PREFIX . "_post.id=" . PREFIX . "_post_extras.news_id) WHERE alt_name ='$news_name' AND date >= '{$year}-{$month}-{$day}' AND date < '{$year}-{$month}-{$day}' + INTERVAL 24 HOUR LIMIT 1";
else $sql_news = "SELECT * FROM " . PREFIX. "_post LEFT JOIN " . PREFIX. "_post_extras ON (" . PREFIX . "_post.id=" . PREFIX . "_post_extras.news_id) where alt_name = '{$_GET['newsid']}'";
if ($subaction == '') $subaction = "showfull";
}
2. In the files /engine/modules/show.short.php, show.custom.php, topnews.php look for:
if( $row['category'] and $config['seo_type'] == 2 ) {] . $row['id'] . "-" . $row['alt_name'] . ".html";
} else {
$full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
} else {
$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
}
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
}
} else {
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
}
and replace with:
if( $row['category'] and $config['seo_type'
] == 2 ) { $full_link = $config['http_home_url'] . get_url( $row['category'] ) . "/" . $row['alt_name'] . ".html";
} else {
$full_link = $config['http_home_url'] . $row['alt_name'] . ".html";
}
} else { $row['id'] . "-" . $row['alt_name'] . ".html";
$full_link = $config['http_home_url'] . date( 'Y/m/d/', $row['date'] ) . $row['alt_name'] . ".html";
}
} else {
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['alt_name'];
}
3. In the /engine/modules/show.full.php files look for:
$full_link = $config['http_home_url'] . $c_url . "/" . $row['id'] . "-" . $row['alt_name'] . ".html";
replace with:
$full_link = $config['http_home_url'] . $c_url . "/" . $row['alt_name'] . ".html";
looking for:
$full_link = $config['http_home_url'] . $row['id'] . "-" . $row['alt_name'] . ".html";
replace with:
$full_link = $config['http_home_url'] . $row['alt_name'] . ".html";
looking for:
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['id'];
replaced by:
$full_link = $config['http_home_url'] . "index.php?newsid=" . $row['alt_name'];
4. Open the /.htaccess file and look for:
# The post itself
and what is under this line (12 lines of code) are deleted (it is shown in the screenshot which lines to delete) and replaced with:
# The post itself
RewriteRule ^([0-9]{4 })/([0-9]{2})/([0-9]{2})/page,([0-9]+),([0-9]+),(.*). html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&cstart=$5&news_name=$6 [L]
RewriteRule ^([0-9]{4})/([0 -9]{2})/([0-9]{2})/page,([0-9]+),(.*).html(/?)+$ index.php?subaction=showfull&year= $1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
RewriteRule ^([0-9]{4})/([0-9]{2})/([0-9]{2})/print:page,([0-9]+),(. *).html(/?)+$ engine/print.php?subaction=showfull&year=$1&month=$2&day=$3&news_page=$4&news_name=$5 [L]
RewriteRule ^([0-9]{4})/( [0-9]{2})/([0-9]{2})/(.*).html(/?)+$ index.php?subaction=showfull&year=$1&month=$2&day=$3&news_name= $4 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+),([0-9]+)-(.*).html( /?)+$ index.php?newsid=$4&news_page=$2&cstart=$3 [L]
RewriteRule ^([^.]+)/page,([0-9]+),([0-9]+) -(.*).html(/?)+$ index.php?newsid=$3&news_page=$2 [L]
RewriteRule ^([^.]+)/print:page,([0-9]+),( [0-9]+)-(.*).html(/?)+$ engine/print.php?news_page=$2&newsid=$3 [L]
RewriteRule ^([^.]+)/(.*). html(/?)+$ index.php?newsid=$2 [L]
RewriteRule ^page,([0-9]+),([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$3 &news_page=$1&cstart=$2 [L]
RewriteRule ^page,([0-9]+),([0-9]+)-(.*).html(/?)+$ index.php?newsid=$2 &news_page=$1 [L]
RewriteRule ^print:page,([0-9]+),([0-9]+)-(.*).html(/?)+$ engine/print.php?news_page= $1&newsid=$2 [L]
RewriteRule ^(.*).html(/?)+$ index.php?newsid=$1 [L]
[/code]
Please help!
Urgently. Thanks in advance.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question