Ben 发表于 2011-7-14 15:54:29

搞不定CSS路径如何写了

<?php echo base_url() ?>css/reset.css

上面是css的路径

css的路径是根目录

根目录的伪静态

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1


<?php

    class Index extends CI_Controller
    {
      function __construct()
      {
            parent::__construct();
            $this->load->helper('url');
      }
      
      function index()
      {
         $this->load->view('admin/index');
      }
    }

上面是控制器的写法

Ben 发表于 2011-7-14 16:04:38

自己来回答下此问题
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|scripts|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1

重写成这样就好了,添加相应的文件夹名称,就可以显示了

jeongee 发表于 2011-7-14 17:02:16

是的,那个地方是要排除重写的文件或者文件夹的
页: [1]
查看完整版本: 搞不定CSS路径如何写了