Yii Framework Forum: Customize url - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

Customize url

#1 User is offline   yiifresh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 1
  • Joined: 28-March 15

Posted 28 March 2015 - 07:15 AM

hi, this is my first post and iam a newbie,

Iam developing a yii app, i work like to customize my url like

example.com/site/mypages/page1 ==> example.com/page1.

And my file structure is like,

protected -> views -> site -> mypages -> pages

and i use site controller for my mypages folder also

thanks in advances
0

#2 User is offline   Rohit Suthar 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 247
  • Joined: 12-May 14
  • Location:Mumbai, India

Posted 08 April 2015 - 02:54 AM

set rules in Url Manager in config like this -

'urlManager'=>array(
    'urlFormat'=>'path',
    'showScriptName'=>false,
    'rules'=>array(
        'page1'=> 'site/mypages/page1',
    )
)

Thanks & regards,

ROHIT SUTHAR
Mumbai(India)

Follow me - @rohisuthar

yii.at

If you found your solutions.... Don't hesitate to click on '+1' button
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • This topic is locked

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