pagination SEO links |
[eluser]Ngulo[/eluser]
Hi guys, i'm in trouble with SEO and pagination. i mean i have a news controller: controller News action index where i list all my news so news page base_url() is this one: www.mysite.com/news when i retrieve data from db and use pagination class i need first of all use as $config['base_url'] = site_url('news/index'); then when outputting my pagination links all will link to with www.mysite.com/news/index/$per_page this is not good first cause for SEO , my pagination first link will link to: www.mysite.com/news/index and my top menu links to www.mysite.com/news hope someone could understand my bad english any suggestion to how to do?
[eluser]darrentaytay[/eluser]
If I understand your problem correctly, one way to fix it is the following: Go to the following folder - application/config Open up routes.php. Inside routes.php add the following route: Code: $routes['news/(:num)'] = "news/index/$1"; This will then make you urls be like: http://www.yoursite.com/news/{per_page}
[eluser]John_Betong[/eluser]
I have had Google Webmaster Tools warnings "Duplicate title tags" and "Duplicate meta descriptions" so in the process of refining this code: // Code: <?php
[eluser]Ngulo[/eluser]
well ... i routes my urls and added conditions all over the site for example $route['news/:num']="news"; then in my __construct() i always put: if($this->uri->segment(2) == 'index'){ redirect(base_url(),'',301);} is for us the better way to remove index actions using always clean urls? in pagination then i set always $pagination['base_url'] = site_url('news'); what you think about it? maybe wrong way ... don't know |
Welcome Guest, Not a member yet? Register Sign In |