Ugly Url's With Pagination

I have following code:
















public function actionIndex() {

            $criteria=new CDbCriteria(array('order'=>'time DESC'));


            $pages=new CPagination($count);




            $this->render('index', array(

                    'models' => $models,

                    'pages' => $pages,





$this->widget('CLinkPager', array(

   'pages' => $pages,



When click on 1st page url is


should be: ../blogNews/index.html

And on 2nd page url is


should be: ../blogNews/index.html?page=2

What can be the problem and why is adding ‘%2FblogNews%2Findex_html=’ ?

I edited CPagination:

//$params=$this->params===null ? $_GET : $this->params;

$params=$this->params===null ? array() : $this->params; //this line added

All working fine but why var_dump($_GET) are returning

array(1) { ["/blogNews/index"]=> string(0) "" }

? Problem with server?

Hi andrzej1_1,

I couldn’t reproduce the issue.

Some questions:

  1. What is the version of Yii?

  2. Is your BlogNews controller in a module?

  3. What do you have in your .htaccess?

  1. Yii 1.1.13

  2. No there isn’t.


<ifmodule mod_deflate.c>

AddOutputFilterByType DEFLATE text/text text/html text/plain text/xml text/css application/x-javascript application/javascript text/javascript


#End Gzip

<IfModule mod_rewrite.c>

 RewriteEngine On

 RewriteBase /

 RewriteCond %{REQUEST_FILENAME} !-f

 RewriteCond %{REQUEST_FILENAME} !-d

 RewriteRule ^(.*)\?*$ index.php?/$1 [L,QSA]


RewriteRule ^(.*)\?*$ index.php/$1 [L,QSA]

instead of

RewriteRule ^(.*)\?*$ index.php?/$1 [L,QSA]

And also note that the guide suggests a very simple rule: