Good day for everyone! I have a bit dumb question. Imagine, we have controller
PHP Code:
class Test {
public function index()
{
echo 'Some page';
}
public function page()
{
echo 'Some page 2';
}
}
So i can call index by url like test/index or i can set routing for that $route['test'] = 'test/index';
So we have that one page(content) have two links! test and test/index and if i write them to address bar result page will the same. So common question is how handle this kind of situations?
For example, maybe i need check in index method do i have second segment equal 'index' and redirect to just 'test' or something?
PHP Code:
public function index()
{
if($this->uri->segments(2) === 'index') redirect('test');
}
How do you handle stuff like this? I think this is all about SEO and so on, what would be the best?