Hi, I am quite new to Yii!
I have a website that was not written by me.
Currently it has the following rules:
'img_thumbs/<type:>/<date:>/<fileName:>' => '/image/get',
'<controller:\w+>/related/<relation:\w+>/<id:\d+>' => '<controller>/related',
'<controller:\w+>/<id:\d+>' => '<controller>/view',
'<controller:\w+>/<action:\w+>' => '<controller>/<action>',
'<_m>' => '/<_m>',
'<_m>/<_c>' => '/<_m>/<_c>',
'<_m>/<_c>/<_a>' => '/<_m>/<_c>/<_a>',
'<controller:\w+>' => '<controller>/index',
I do understand only first line and I have some notion about what next three lines mean.
- However I do not understand why last four lines are here??? Could you give me some clues about it, please.
All this started because I wanted to rewrite url for static pages. Static pages views are place in folder views/site/pages. CViewAction is used for static pages.
I wanted www.mypage.com/site/page?view=about to be www.mypage.com/about. So I added the following line (above all other lines):
'<view:(home|about|offer|toknow|delivery|contacts|)>' => '/site/page', // /site/page?view=about -> /about
- At first it seemed to be working, but the problem appears that with this line when I open www.mypage.com it shows Error 404 and says that "It cannot find view index". For test I place "index.html" file into views/site/pages and it worked. So the problem is - why with the line above www.mypage.com is rendered as static file (views/site/pages/index.php) instead of calling Site controller action actionIndex() and render index file in normal way (using view views/site/index.php)?
Thank you!