Hi Everyone,
In my route.php, i have this setting below. This will use the parameter to retrieve page urls in the database
$route['(:any)'] = 'page/index/$1';In the Page controller, I have this below:
class Page extends CI_Controller {
function __construct() {
parent::__construct();
}
public function index( $page )
{
$data = array();
$page_data = $this->page_model->getPageData( $page );
if ( !empty( $page_data ) )
{
$data = array(
'page' => $page,
'page_data' => $page_data,
);
}
else
{
$data = $this->page_model->getUnavailableData();
}
$this->load->view('main', $data);
}
}For example, if the page is www.site.com/about its a valid data. But if the url is www.site.com/about-me, it did not go to the 404 page set in the routes.php. I tried to comment the
$data = $this->page_model->getUnavailableData();but it cause errors in the page.
Can you please advise what is the best approach for this. Google Webmaster Tool is telling that the site got increase of 404 urls.
Thanks in advance.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.