step1錛歒ii鐨勯厤緗枃浠禼onfig/main.php涓?div>'components'涓嬪鍔?div> 1 'urlManager'=>array(
2 'urlFormat'=>'path',
3 'showScriptName' => false,
4 'rules'=>array(
5 'urls.js' => 'workspace/urls',
6 'env.js' => 'workspace/env',
7 '<controller:\w+>/<id:\d+>'=>'<controller>/view',
8 '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>',
9 '<controller:\w+>/<action:\w+>'=>'<controller>/<action>',
10 ),
11 ),
step2錛氬紑鍚疉pache鐨勯厤緗枃浠秇ttpd.conf涓璍oadModule rewrite_module modules/mod_rewrite.so鍜孉llowOverride灞炴ц緗負(fù)All
step3錛氱紪鍐欎竴涓?htaccess鏂囦歡鏀懼湪app鐨勬牴鐩綍錛屾坊鍔犱互涓嬪嚑琛屽埌鏂囦歡涓?br />Options +FollowSymLinks
IndexIgnore */*
RewriteEngine on
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# otherwise forward it to index.php
RewriteRule . index.php

]]>