在使用CI框架的使用经常碰到跳转和路径方面的问题,site_url()和base_url()很容易混淆,下面来说说他们的区别! 假如你config文件里面的base_url和index_page是这样定义的: config['base_url'] = "http://ricky.com/"; config['index_page'] = "index.php"; 那么你若使用site_url("php/shop");则实际url为 http://ricky.com/index.php/php/shop 若使用base_url("php/shop");则url为: http://ricky.com/php/shop base_url()少了一个index.php