Welcome Guest, Not a member yet? Register   Sign In
issue for rewrite link in multilang site
#1

(This post was last modified: 02-22-2021, 10:57 AM by eleumas.)

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!
Reply




Theme © iAndrew 2016 - Forum software by © MyBB