php - Yii 1.1 routes for some pages -


i'm new routes.

the website in yii 1.1 easy me write. want

  • http://someurl.com/admin

points

  • http://someurl.com/index.php?r=admin/index

i have tried different things no success.

here how have tried configure routes:

'urlmanager' => array(     'rules' => array(         '<alias:admin>' => 'admin/index',         '<alias:admin>' => 'site/<alias>',         '<controller:\w+>' => '<controller>/view',         'admin' => 'admin/index',         'admin/index' => 'admin',     ), ), 

what solution?

to remove ?r= part, have set url format "path", in config file:

array(     ......     'components'=>array(         ......             'urlmanager'=>array(             'urlformat'=>'path',         ),     ), ); 

i've not tested route config should be:

array(     'admin' => 'admin/index', ) 

and rid of index.php, have change apache configuration (if you're using apache obviously)

rewriteengine on  # if directory or file exists, use directly rewritecond %{request_filename} !-f rewritecond %{request_filename} !-d  # otherwise forward index.php rewriterule . index.php 

you'll find more detailed explanations in doc: http://www.yiiframework.com/doc/guide/1.1/en/topics.url


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -