在根目录里添加一个名为.htaccess的文件,内容为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
|
然后修改你的ci框架中 application/config文件夹中的 routes.php:
1 2 |
|
控制器中
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Indexx extends CI_Controller { public function index() { $base_url = $this->config->item('base_url'); $this->load->view('indexx/index',array('base_url'=>$base_url)); } }
视图中
<link href="<?php echo $base_url; ?>static/admin/style/bootstrap.css" rel="stylesheet"> <link href="<?php echo $base_url; ?>static/admin/style/font-awesome.css" rel="stylesheet"> <link href="<?php echo $base_url; ?>static/admin/style/weather-icons.css" rel="stylesheet"> <!--Beyond styles--> <link id="beyond-link" href="<?php echo $base_url; ?>static/admin/style/beyond.css" rel="stylesheet" type="text/css"> <link href="<?php echo $base_url; ?>static/admin/style/demo.css" rel="stylesheet"> <link href="<?php echo $base_url; ?>static/admin/style/typicons.css" rel="stylesheet"> <link href="<?php echo $base_url; ?>static/admin/style/animate.css" rel="stylesheet">