Ascomae
(Ckuetbach)
1
Hello,
I've got a question about urlManager and rules.
'urlManager'=>array(
'urlFormat'=>'path',
'rules'=>array(
'web/id/<id:d+>'=>'pages/show',
'web/<path:w+>'=>'pages/show',
The first rule works. On Link to pages will be like this:
domain.tld/index.php/web/id/23
But I'd like to have my URLs like this:
domain.tld/index.php/web/path/to/file.html
But if i use this rule I'll get:
exception 'CHttpException' with message 'The requested controller "web" does not exist.'
Where is my mistake?
Thanks,
Christian
qiang
(Qiang Xue)
2
The second rule should be ended with '/*' so that additional parameters can be appended to the path info.
Ascomae
(Ckuetbach)
3
Thanks for your fast answer,
'web/<path:w+>/*'=>'pages/show',
is better, but don't work, too:
Quote
domain.tld/index.php/web/path/to/file.html
echo $_GET[path]; //'path'
The path is not complete.
It is ‘path’ not ‘path/to/file.html’.
Christian
Ascomae
(Ckuetbach)
4
Is this possible or do I have to extend CUrlManger an implement my own Version?
Christian
Ascomae
(Ckuetbach)
5
'web/<path:(.*)>'=>'pages/show'
domain.tld/index.php/web/this/is/my/path.php => ?r=pages/show&path=this/is/my/path.php
Sometimes it the easiest way is the best.
Christian