Hi! I have this controller:
PHP Code:
public function article($slug)
{
$data['article'] = $this->articlesModel->where('slug', $slug)->first();
$dataArticle = $data['article'];
$data['title'] = $dataArticle['meta_title'];
$data['metaDescription'] = $dataArticle['meta_description'];
return view('article', $data);
}
This link in categories view:
PHP Code:
<?php $slug = $a['slug'];?>
<a href="<?php echo base_url('en/'.$slug);?>" target="_blank">
<?php echo $a['heading'];?>
</a>
And this (wrong) route:
PHP Code:
$routes->add('(:any)/it/(:any)', 'It/Main::article/$1');
What is the solution for open the article page with link: mysite.com/en/article-slug and not have 404 or a link like
mysite.com/en/article/article-slug?
Thanks for the support!