CodeIgniter 起手式(1)
咁做Development梗係貪用MS OS 0既, 用開又方便嘛.
例牌用Xampp行, 無奈CI 要 用index.php 做 default controller, 換言之要: http://localhost/ci2/index.php/$functions. 煩死得0黎又唔好睇
梗係變做 localhost/ci2/$function 就ok 啦...well...
例牌用Xampp行, 無奈CI 要 用index.php 做 default controller, 換言之要: http://localhost/ci2/index.php/$functions. 煩死得0黎又唔好睇
梗係變做 localhost/ci2/$function 就ok 啦...well...
- Confirm Xampp 行緊mod_rewrite
- 在ci2 的base 用 cmd mode generate 個吉的 .htaccess (檔案總管會孖叉0既)
- 加入以下東西到 .htaccess:
Options FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
- config/config.php 中修改兩項:
$config['base_url'] = "http://localhost/$ci2Path/"$config['index_page'] = "";
Labels: codeigniter

0 Comments:
Post a Comment
<< Home