1
2
3
4
5
6
7
8
9
| 'urlManager'=>array( 'urlFormat'=>'path', 'showScriptName'=>false, 'rules'=>array( '<controller:\w+>/<id:\d+>'=>'<controller>/view', '<controller:\w+>/<action:\w+>/<id:\d+>'=>'<controller>/<action>', '<controller:\w+>/<action:\w+>'=>'<controller>/<action>', ),), |
Buat file .htaccess dan letakkan pada folder root. Berikut isi dari file .htaccess
1
2
3
4
5
6
7
8
9
10
| Options +FollowSymLinksIndexIgnore */*RewriteEngine on# ganti nama web aplikasi anda di bawah iniRewriteBase /nama_web_aplikasi/# if a directory or a file exists, use it directlyRewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d# otherwise forward it to index.phpRewriteRule . index.php |
WARNING: pada file .htaccess perhatikan baris ke-5 sesuaikan RewriteBase dengan direktori anda, jika ada di root (aplikasi bukan dalam folder) maka anda cukup RewriteBase /
Semoga informasi ini bermanfaat bagi anda.
Comments :
Posting Komentar