Yii Framework Forum: Looking for help with urls - Yii Framework Forum

Jump to content

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

Looking for help with urls

#1 User is offline   Kacykos 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 12-March 18

Posted 12 March 2018 - 01:49 PM

Hi i have yii website script and I don't know how to change urls from mydomain.com/account/login to mydomain.com/login.
Can someone write instruction for me? I can send you ftp details to login on serverif you need it. Thanks for help
0

#2 User is offline   voime 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 09-June 11

Posted 13 March 2018 - 05:06 AM

config urlmanager
'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'rules' => [
                // custom rules
                'login' => 'account/login',
                // default rules
                '<controller:\w+>/<id:\d+>' => '<controller>/view',
                '<controller:\w+>/<action:\w+>/<id:\d+>' => '<controller>/<action>',
                '<controller:\w+>/<action:\w+>' => '<controller>/<action>',
            ],
        ],

0

#3 User is offline   Kacykos 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 12-March 18

Posted 13 March 2018 - 12:10 PM

Thanks for reply i Have this
 'urlManager' => [
            'enablePrettyUrl' => true,
            'showScriptName' => false,
            'enableStrictParsing' => false,
            'rules' => [
                'search' => 'site/search',
                'contact' => 'site/contact',
                '<controller:conversation>/<action:delete>' => '<controller>/<action>',
                '<controller:conversation>/<action:reply>/<conversation_uid:[a-z0-9_\-]+>' => '<controller>/<action>',
                '<controller:account>/<action:invoices>/<page:\d+>' => '<controller>/<action>',
                '<controller:account>/<action:conversations>/<page:\d+>' => '<controller>/<action>',
                '<controller:listing>/<action:index|update|package|preview>/<slug:[a-z0-9_\-]+>' => '<controller>/<action>',
                'page/<slug:[a-z0-9_\-]+>' => 'pages/index',
                '<controller:category>/<action:location>' => '<controller>/<action>',
                [
                    'pattern' => 'category/<slug:[a-z0-9_\-]+>/<page:\d+>',
                    'route' => 'category/index',
                ],
                [
                    'pattern' => 'category/<slug:[a-z0-9_\-]+>',
                    'route' => 'category/index',
                ],
                [
                    'pattern' => 'store/<slug:[a-z0-9_\-]+>/<page:\d+>',
                    'route' => 'store/index',
                ],
                [
                    'pattern' => 'store/<slug:[a-z0-9_\-]+>',
                    'route' => 'store/index',
                ],
                '<url:.+/>' => 'site/redirect'
            ],
        ],


if i change 'search' => 'site/search', to 'search' => 'site/szukaj'

mydomain.com/szukaj don't work ;/
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