Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Problems With Url Rewriting

$
0
0
Hi,

I am quite new in url rewriting and I have a problem.

I have a "lang" parameter which is used to modify the language in each request. If I write the following the site doesn't display well (images are not shown)
      'urlManager'=>array(
	     'urlFormat'=>'path',
            'showScriptName'=>false,
            'rules'=>array(
                '<lang:\w+>'=>'site/index',
                '<lang:\w+>/<action:\w+>'=> 'site/<action>',
            ),
	),


However if I change the slash of the second rule (/) to a hyphen (-) works well:
      'urlManager'=>array(
	     'urlFormat'=>'path',
            'showScriptName'=>false,
            'rules'=>array(
                '<lang:\w+>'=>'site/index',
                '<lang:\w+>-<action:\w+>'=> 'site/<action>',
            ),
	),


Does anybody know the explanation of this error? I would like the rule with a slash, not a hyphen

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>