http://www.example.com/articles/23/1/My-Example-Article/Page1.html
to
http://www.example.com/articles-23-1-My-Example-Article-Page1.html
To do this, open up /admin/includes/classes/class.helper.php and find the ArticleLink() function which looks like:
function ArticleLink($ArticleId, $ArticleTitle, $ArticlePage = 1) {
if ($GLOBALS['AL_CFG']['useids'] == 1) {
$link = sprintf("%s/%s/%d/%d/", $GLOBALS["AL_CFG"]["siteURL"], GetLang('urlArticles'),
$ArticleId, $ArticlePage);
} else {
$suffix = sprintf("%s/%s%d.html", AL_HELPER::_MakeArticleURLSafe($ArticleTitle), AL_HELPER::_MakeArticleURLSafe(GetLang('artPage')), $ArticlePage);
$link = sprintf("%s/%s/%d/%d/%s", $GLOBALS["AL_CFG"]["siteURL"], GetLang('urlArticles'), $ArticleId, $ArticlePage, $suffix);
}
return $link;
}and can change it to something like this (which changes the /'s to -'s in the URL so it looks like the article.html file is in the base folder)
function ArticleLink($ArticleId, $ArticleTitle, $ArticlePage = 1) {
if ($GLOBALS['AL_CFG']['useids'] == 1) {
$link = sprintf("%s/%s/%d/%d/", $GLOBALS["AL_CFG"]["siteURL"], GetLang('urlArticles'),
$ArticleId, $ArticlePage);
} else {
$suffix = sprintf("%s-%s%d.html", AL_HELPER::_MakeArticleURLSafe($ArticleTitle), AL_HELPER::_MakeArticleURLSafe(GetLang('artPage')), $ArticlePage);
$link = sprintf("%s/%s-%d-%d-%s", $GLOBALS["AL_CFG"]["siteURL"], GetLang('urlArticles'), $ArticleId, $ArticlePage, $suffix);
}
return $link;
}Then open up /includes/classes/class.article.php and find:
$this->SetId($this->GetIdFromURL(GetLang('urlArticles')));and on a new line *before* that, add this line:
$this->Delimiter = '-';
That should now work. If you want to remove 'Page1' from the URL, reedit the ArticleLink function in the class.helper.php file and change:
$suffix = sprintf("%s-%s%d.html",
AL_HELPER::_MakeArticleURLSafe($ArticleTitle),
AL_HELPER::_MakeArticleURLSafe(GetLang('artPage')), $ArticlePage);to
$suffix = sprintf("%s.html",
AL_HELPER::_MakeArticleURLSafe($ArticleTitle));