|
![](static/image/common/ico_lz.png)
楼主 |
发表于 2012-3-29 15:12:33
|
显示全部楼层
添加了一个.htaccess 文件,内容是这样:
- RewriteEngine On
- RewriteBase /CodeIgniter_2.1.0_1/
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ /CodeIgniter_2.1.0_1/index.php?/$1 [L]
复制代码
修改了 system/core/URI.php 文件的 _set_uri_string 函数和 _explode_segments 函数
PHP复制代码
/**
* Set the URI String
*
* @access public
* @param string
* @return string
*/
function _set_uri_string ($str) {
if ($this->config->item("base_folder")) {
if ($str == $this->config->item("base_folder")) {
$str = "";
}
}
// Filter out control characters
$str = remove_invisible_characters ($str, FALSE);
// If the URI contains only a slash we'll kill it
$this->uri_string = ($str == '/') ? '' : $str;
}
/**
* Explode the URI Segments. The individual segments will
* be stored in the $this->segments array.
*
* @access private
* @return void
*/
function _explode_segments () {
$is_ignored = FALSE;
foreach (explode("/", preg_replace("|/*(.+?)/*$|", "\\1", $this->uri_string)) as $val) {
// Filter segments for security
$val = trim($this->_filter_uri ($val));
if ($val != '') {
if (!$is_ignored && $this->config->item("base_folder")) {
if ($val == $this->config->item("base_folder")) {
$is_ignored = TRUE;
continue;
}
}
$this->segments[] = $val;
}
}
}
复制代码
在 application/config/config.php 里面增加了配置:
PHP复制代码
$config['base_folder'] = 'CodeIgniter_2.1.0_1';
复制代码
OK,现在就可以运行了。
|
|