數據庫參數的設置在application/config/database.php
code igniter index.php的welcome page的設置在application/config/routes.php
by default welcome controller page
$route['default_controller'] = "welcome";
codeigniter的index.php裏的基本設置
define('ENVIRONMENT', 'development'); //當launch時,設置爲production
$system_path = 'system'; //"system" folder path
$application_folder = 'application'; //"system" folder path
application/config/config.php的基本設置:
$config['base_url'] = "http://www.cnmiss.cn/"
您網站的網址,codeigniter 會根據這個網址來生成鏈接、表單地址等。
$config['index_page'] = "index.php"
codeigniter 根目錄下的 index.php 文件名,codeigniter 會使用它來生成鏈接地址。如果使用隱藏 index.php 的URL,將其設置爲空字符串:$config['index_page']
= ""。
去掉URL中的index.php的步驟 http://justcoding.iteye.com/blog/547350
$config['uri_protocol'] = "AUTO"
codeigniter 生成 URL 使用的格式,設置爲“AUTO”自動探測。如果鏈接不能正常工作,可以嘗試以下值:
PATH_INFO、QUERY_STRING、REQUEST_URI、ORIG_PATH_INFO。
$config['url_suffix'] = ""
codeigniter 產生鏈接時使用的 URL 後綴,如果要實現僞靜態,可以設置 $config['url_suffix'] = ".html"。
$config['language'] = "english"
codeigniter 程序默認使用的語言
$config['charset'] = "UTF-8"
codeigniter 程序默認使用的字符集
$config['enable_hooks'] = FALSE
是否啓用鉤子,鉤子功能使得您可以在不修改系統核心文件的基礎上來改變或增加系統的核心運行功能。
$config['subclass_prefix'] = 'MY_'
設置擴展 codeigniter 類庫時使用的類名前綴
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-'
設置 codeigniter URL 中允許使用的字符,這是一個正則表達式。當訪問者試圖訪問的 codeigniter URL 包含其它字符時,會得到一個警告。應該儘量限制 codeigniter URL 使用的字符來提高安全性,可以有效的過濾注入攻擊。如果設置爲空,允許使用所有字符,強烈建議不要這麼做。
$config['enable_query_strings'] = FALSE
codeigniter URL 默認使用分段的 URL,此選項也允許 codeigniter 開啓查詢字符串形式 URL。您可以使用查詢字符串來傳遞要訪問的控制器和函數。例如: index.php?c=controller&m=method。codeigniter 默認使用分段的URL,查詢字符串的 URL 很多特性不被支持。
$config['controller_trigger'] = 'c'
codeigniter 將查詢字符串中此選項對應的值當做 codeigniter 控制器的名字。
$config['function_trigger'] = 'm'
codeigniter 將查詢字符串中此選項對應的值當做 codeigniter 控制器方法的名字
$config['log_threshold'] = 0
啓用錯誤日誌,設置記錄哪些類型的錯誤。
0 = 關閉錯誤日誌記錄
1 = 記錄錯誤信息
2 = 記錄調試信息
3 = 記錄通知信息
4 = 記錄所有信息
$config['log_path'] = ''
如果您不想使用默認的錯誤日誌記錄目錄配置(system/logs/),可以設置完整的服務器目錄。
$config['log_date_format'] = 'Y-m-d H:i:s'
codeigniter 錯誤日誌時間格式
$config['cache_path'] = ''
如果您不想使用默認的緩存目錄(system/cache/)來存儲緩存,可以設置完整的服務器目錄
$config['encryption_key'] = ""
codeigniter 使用的密鑰
$config['global_xss_filtering'] = FALSE
是否對輸入數據(GET、POST)自動過濾跨腳本攻擊
$config['compress_output'] = FALSE
啓用Gzip壓縮達到最快的頁面加載速度
$config['time_reference'] = 'local'
設置時間格式:"local"、"GMT"
$config['rewrite_short_tags'] = FALSE
如果您想要使用短標記,但 PHP 服務器不支持,codeigniter 可以通過重寫短標記來支持這一功能。
$config['proxy_ips'] = ''
如果訪問者通過代理服務器來訪問您的網站,您必須設置代理服務器 IP 列表,以識別出訪問者真正的 IP
* 在codeigniter中的url中混合使用querystring和segment
目前測試的結果是codeigniter by default 支持混合的。可以通過
$this->input->get('some_variable', TRUE);
來獲取GET parameter
ref links:
http://stackoverflow.com/questions/2171185/codeigniter-php-framework-need-to-get-query-string
http://codeigniter.com/user_guide/libraries/input.html
另外還有其他solutions:
http://gpiot.com/code-igniter-mixing-segment-based-url-with-get-querystring/
http://www.askaboutphp.com/58/codeigniter-mixing-segment-based-url-with-querystrings.html
http://stackoverflow.com/questions/2171185/codeigniter-php-framework-need-to-get-query-string
http://blog.shian.tw/codeigniter-query-string-get.html
http://jackyrong.iteye.com/blog/897295
轉載於:http://blog.csdn.net/totogogo/article/details/7734887