CPagination URL adding .html extension when not needed

I am not sure if this is the expected behavior and I am just implementing this incorrectly, but the CPagination module is creating different URLs which may cause Google to see duplicate content on different URLs due to the urlSuffix.

I have a directory that lists articles:


http://example.com/articles/

My config/main.php has urlSuffix=>’.html’ and provides articles URLs in the form of:


http://example.com/articles/some-interesting-title.html

The CPagination module is creating URLs for each directory page in the form of


http://example.com/articles.html?page=2

instead of


http://example.com/articles/?page=2

My questions are:

  1. Can the pagination URL, for the directory listing, be /articles/?page=2 or some variation without the .html extension? While still maintaining the .html extension on the individual articles?

  2. On some pages, perhaps my routes are wrong, the pagination URL looks like this:


http://example.com/articles.html?q=articles&page=2

It seems to be finding the correct route and creating /articles, but it also appends q=articles

My route looks like:


'<directory:\w+>'=>'article/list'

I’ve tried this in both 1.0.9 and 1.0.10 with the same issue. Thank you in advance.

bump? anyone?

Yes, it’s possible. See the green info block at http://www.yiiframework.com/doc/guide/topics.url

Great, thanks qiang. I changed my route with the new routing syntax and the .html suffix is no longer on the top level directory:


'<directory:\w+>'=>array('article/list','urlSuffix'=>'')

Thanks again!