How to: change news url to your own language News -> e.g. Niews
Posted: Fri Dec 05, 2008 7:26 pm
Hello all,
For a website of my customer I wanted to change toe URL of the news module. In CMS MS 1.5.1 it's standard like:
http://domain.com/news/1/55/Test/description/
This topic is going to teach u guys how to change it to the `news` part to your own language!
For example: http://domain.com/nieuws/1/55/Test/description/ ( nieuws = dutch for news )
'Replace by' are examples, can also choose your own word instead "News".
On your server change:
modules/news/action.default.php:
rule 325:
$onerow->file_location = $config['uploads_url'].'/news/id'.$row['news_id'];
replace by:
$onerow->file_location = $config['uploads_url'].'/nieuws/id'.$row['news_id'];
rule 339:
$prettyurl = 'news/'.$row['news_id'].'/'.($detailpage!=''?$detailpage:$returnid)."/$aliased_title";
replace by:
$prettyurl = 'nieuws/'.$row['news_id'].'/'.($detailpage!=''?$detailpage:$returnid)."/$aliased_title";
modules/news/action.detail.php:
rule 91:
$onerow->file_location = $config['uploads_url'].'/news/id'.$row['news_id'];
replace by:
$onerow->file_location = $config['uploads_url'].'/nieuws/id'.$row['news_id'];
modules/news/News.module.php:
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)\/d,(?P.*?)$/');
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/');
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)\/(?P[0-9]+)$/');
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)$/');
replace by:
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)\/d,(?P.*?)$/');
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/');
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)\/(?P[0-9]+)$/');
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)$/');
Hope to help you guys out with it
GL.
For a website of my customer I wanted to change toe URL of the news module. In CMS MS 1.5.1 it's standard like:
http://domain.com/news/1/55/Test/description/
This topic is going to teach u guys how to change it to the `news` part to your own language!
For example: http://domain.com/nieuws/1/55/Test/description/ ( nieuws = dutch for news )
'Replace by' are examples, can also choose your own word instead "News".
On your server change:
modules/news/action.default.php:
rule 325:
$onerow->file_location = $config['uploads_url'].'/news/id'.$row['news_id'];
replace by:
$onerow->file_location = $config['uploads_url'].'/nieuws/id'.$row['news_id'];
rule 339:
$prettyurl = 'news/'.$row['news_id'].'/'.($detailpage!=''?$detailpage:$returnid)."/$aliased_title";
replace by:
$prettyurl = 'nieuws/'.$row['news_id'].'/'.($detailpage!=''?$detailpage:$returnid)."/$aliased_title";
modules/news/action.detail.php:
rule 91:
$onerow->file_location = $config['uploads_url'].'/news/id'.$row['news_id'];
replace by:
$onerow->file_location = $config['uploads_url'].'/nieuws/id'.$row['news_id'];
modules/news/News.module.php:
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)\/d,(?P.*?)$/');
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/');
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)\/(?P[0-9]+)$/');
$this->RegisterRoute('/[nN]ews\/(?P[0-9]+)$/');
replace by:
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)\/d,(?P.*?)$/');
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)\/(?P[0-9]+)\/(?P.*?)$/');
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)\/(?P[0-9]+)$/');
$this->RegisterRoute('/[nN]ieuws\/(?P[0-9]+)$/');
Hope to help you guys out with it
