# rozov97 (25.08.2022 / 11:26)
Подскажите, пожалуйста, как правильно изменить ссылку на новости, чтобы модуль открывался не по /news/*, а на /blog/*?
Ссылки в шаблонax модуля поменять
modules/templates/
Возможно еще есть редиректы в контроллерах.
Роутер
config/routes.php строки
:
$map->addRoute(['GET', 'POST'], '/news/search/', [SearchController::class, 'index']);
$map->addRoute(['GET', 'POST'], '/news/search_tags/', [SearchController::class, 'byTags']);
$map->addRoute(['GET', 'POST'], '/news/add_vote/{article_id:\d+}/{type_vote:\d}/', [VoteController::class, 'add']);
$map->addRoute(['GET', 'POST'], '/news/comments/{article_id:\d+}/', [CommentsController::class, 'index']);
$map->addRoute(['GET', 'POST'], '/news/comments/add/{article_id:\d+}/', [CommentsController::class, 'add']);
$map->addRoute(['GET', 'POST'], '/news/comments/del/', [CommentsController::class, 'del']);
if ($user->isValid() && empty($user->ban)) {
$map->addRoute(['GET', 'POST'], '/news/comments/upload_file[/]', [CommentsController::class, 'loadFile']);
}
if ($user->rights >= 9 && $user->isValid()) {
$map->addRoute(['GET', 'POST'], '/admin/news/', [AdminController::class, 'index']);
$map->addRoute(['GET', 'POST'], '/admin/news/content/[{section_id:\d+}[/]]', [AdminController::class, 'section']);
$map->addRoute(['GET', 'POST'], '/admin/news/settings/', [AdminController::class, 'settings']);
$map->addRoute(['GET', 'POST'], '/admin/news/edit_article/{article_id:\d+}[/]', [AdminArticleController::class, 'edit']);
$map->addRoute(['GET', 'POST'], '/admin/news/add_article/[{section_id:\d+}[/]]', [AdminArticleController::class, 'add']);
$map->addRoute(['GET', 'POST'], '/admin/news/del_article/{article_id:\d+}[/]', [AdminArticleController::class, 'del']);
$map->addRoute(['GET', 'POST'], '/admin/news/add_section/[{section_id:\d+}[/]]', [AdminSectionController::class, 'add']);
$map->addRoute(['GET', 'POST'], '/admin/news/edit_section/{section_id:\d+}[/]', [AdminSectionController::class, 'edit']);
$map->addRoute(['GET', 'POST'], '/admin/news/del_section/{section_id:\d+}[/]', [AdminSectionController::class, 'del']);
$map->addRoute(['GET', 'POST'], '/admin/news/upload_file[/]', [AdminArticleController::class, 'loadFile']);
}
$map->addRoute(['GET', 'POST'], '/news/[{category:[\w/+-]+}]', [SectionController::class, 'index']);
$map->addRoute(['GET', 'POST'], '/news/{category:[\w/+-]+}/{article_code:[\w.+-]+}.html', [ArticleController::class, 'index']);
$map->addRoute(['GET', 'POST'], '/news/{article_code:[\w.+-]+}.html', [ArticleController::class, 'index']);