关于 module 的 地址重写

module 有两个( front[网站前端] , adminmanage[网站管理端] )

前端做url地址重写时,希望只是将front这个module重写到网站根目录,

我现在是这样处理的



'urlManager'=>array(


       'urlFormat'=>'path',


       'showScriptName'=>false,


       'urlSuffix'=>'.html',


       'rules'=>array(


                         //新闻中心


                  'news/*' => 'front/news/index',


                         //关于


                  'about'=>'front/about/about',


                         'contact'=>'front/about/contactus',


                         'sitemap'=>'front/default/sitemap',


                         //产品


                 'product/*'=>'front/product/index',


                        //人力资源


                 'hr/*'=>'front/hr/index',


                       'job/*'=>'front/hr/list',				


                       //网络建议


                'network/*'=>'front/network/index',


                       //FAQ


                      'faq/*'=>'front/faq/index',


              ),


),


如果这样处理,前端其它的地址全部都要进行配置.感觉很麻烦!

如果将front module里的控制器,以及视图文件移动到application.controllers下,这样要修改的链接比较多.

问题一:

有没有方法有现有的基础上,在urlManager的有一条规则可以将front这个module重写到网站根目录下呢?

问题二:

上面配置后的adminmanage module所有的链接地址都加上了.html

能否地址重写时只重写front module 不重写 adminmanage module

Quote

'article_<articleId:\d+>'=>array('portal/default/article', 'urlSuffix'=>'.html','urlFormat'=>'path'),

这个应该可以解决你的问题。只改前台。

这样还是无法解决这个问题

有没有方法有现有的基础上,在urlManager的有一条规则可以将front这个module重写到网站根目录下呢?

楼上所说的方法,需要将前台所有的地址都要进行规则的重写。

你可以用下面的规则,可以少写几条:



'<controller:(news|product|network|hr|faq)>/*' => 'front/<controller>/index',