Codeigniter没有加载css / htaccess

时间:2014-07-07 03:27:02

标签: php css .htaccess codeigniter

我有这个功能

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Profile extends CI_Controller {

    public function __construct(){
            parent::__construct();
           $this->load->library('session');
           $this->load->helper('form');
           $this->load->model('Mdl_profile');
           $this->load->helper('string');
       }
    function index(){

            $this->load->view('buttons/welcome');
        }

        function success(){
            $this->load->view('buttons/welcome2');
        }
}

问题是,当我转到profile/success时,CSS没有加载。 在inspect元素中,css的路径为localhost/project/profile/css/style.css 而不是localhost/project/css/style.css

我有一个.htaccess文件

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css|design|img|js)
RewriteRule ^(.*)$ /a-cat/index.php/$1 [L]
</IfModule>

0 个答案:

没有答案