msams
(Msams992000)
1
When using paths with urlManager, to make pretty URLs, the pagination always has an extra "q=" parameter. For example with yii-user:
config/main.php:
'urlManager'=>array(
'useStrictParsing'=>true,
'urlFormat'=>'path',
'rules'=>array(
'user'=>'user/user/index',
The first page of users is located at example.com/user as expected. But the pagination links are:
example.com/user?q=user&page=2
When it should be:
example.com/user?page=2
Is this possible? Do I have to add <page> as a variable in main.php? Does it have to be example.com/user/2?
Why is it repeating the path with the "q" variable?
rudenich
(Rudenich)
2
Yes
add one rule in the beginning
'urlManager'=>array(
'useStrictParsing'=>true,
'urlFormat'=>'path',
'rules'=>array(
'user/page/<page:[0-9]>'=>'user/user/index',
'user'=>'user/user/index',
gallyamow
(Gallyamow)
3
I had this promblem. If you use nginx check your site config file. Maybe "q" parameter add nginx.
location / {
index index.html index.php;
try_files $uri $uri/ /index.php?q=$uri&$args;
}