CI基本設定與login頁面建立
1.下載codenogiter
將壓縮檔下的資料上傳至放置網頁的空間中
2.建立.htaccess => ci去掉index.php的方式
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /CI/
RewriteCond $1 !^(index\.php|images|swf|uploads|js|css|assets|robots\.txt|$)
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
</IfModule>
#RewriteEngine on
#RewriteBase /
#RewriteCond $1 !^(index\.php|images|robots\.txt|$)
#RewriteRule ^(.*)$ index.php/$1 [L,QSA]
3.在URL 移除 index.php
編輯application/config/config.php
將$config['index_page'] = 'index.php';改成$config['index_page'] = '';
4.修改application/autoload.php
原 $autoload['libraries'] = array();
修改為 $autoload['libraries'] = array('database','session');
5.編輯 application/config/database.php
6.編輯application/config/autoload.php
將$autoload['helper'] = array();
修改為 $autoload['helper'] = array('form','url');
7.將application/controllers/welcome.php檔名改成main.php ,並對內容作修改
8.將 application/views/welcome_message.php 檔名改成 login.php ,並對內容修改
9.修改 application/config/routes.php
10.測試一下網頁是否能正常出現