Yii Framework Forum: friendly urls question - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

friendly urls question yii 1.1 Rate Topic: -----

#1 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 751
  • Joined: 02-February 09

Posted 08 July 2010 - 05:31 AM

I am trying to design friendly urls for an application I am developing.

Currently, I am trying to do that via parametirizing routes. I have the following code:
'urlFormat'=>'path',
                    'showScriptName'=>false,
                    'rules'=>array(
                        '<_a:(contact)>/<lang:\w+>' => '<_a>',
                    ),


What I don't like is that my urls look like this: mydomain.com/site/contact/lang/en

What should I change to achieve: mydomain.com/contact/en through Parameterizing routes.

I can achieve this with 'pattern1'=>'route1', but I want to achieve it with parameterizing routes method so I can use the expression to reduce the number or rules for better performance as advised in the article. Any help would be appreciated.

bettor
0

#2 User is offline   bettor 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 751
  • Joined: 02-February 09

Posted 09 July 2010 - 02:19 AM

I seem to have found a way to achieve what I want but another issue is I cannot get the case insensitive to work with parameterizing routes:

Why is 'caseSensitive'=>false not working in the below code:
'urlFormat'=>'path',
                    'showScriptName'=>false,
                    'rules'=>array(
                        '<_a:(contact|about)>/<lang:\w+>' => array('<_a>/index', 'caseSensitive'=>false),
                    ),


For some reason the above 'caseSensitive'=>false is not applied. If anybody has any idea please share.

Cheers,
bettor
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users