When i enter my google analytics, on Pages, under Content tab, i see indexed links like this:
/index.php/my_controller/index/my_controller_page/23/my_controller_sort/status.desc.
How can i remove these from google and how i prevent them in first place from being indexed or generated.
Note, that am using the Yii framework.
Edit 1: the problem appear both in CLinkPager and CListView. Extending the CListView (suggested below) solves partially the problems only on Sort by … criteria. To solve the problem with CLinkPager (when you don’t have rewrite rules defined for paging) i have modified the source CLinkPager.php with:
return '<li class="'.$class.'">'.CHtml::link($label,$this->createPageUrl($page),array('rel'=>'nofollow')).'</li>';
and works.
It appears that you’re using
CGridView,CListViewor some other builtin widget to display a sortable list of items, and Google is following the sort links.There might be a better way depending on which widget this is, but you will probably need to extend the classes responsible for rendering to do this manually.
If you’re using
CListView, this topic might help.If you’re using a
CGridView, you would extendCDataColumnand override itsrenderHeaderCellContentmethod to passarray('rel' => 'nofollow')as the third argument when callinggetSort()->link(...).