Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
codeigniter资产处理故障_Codeigniter - Fatal编程技术网

codeigniter资产处理故障

codeigniter资产处理故障,codeigniter,Codeigniter,我很难在CodeIgniter上链接我的css和js文件。我是codeigniter的新手,需要一些帮助。我在寻找,但找不到真正有效的解决办法。我的文件夹结构如下: -> system -> application -> js -> jquery.js -> css -> style.css -> images -> .htaccess -> index.php 我的基本url就像在子域上工作一样 这是我给出的pass out/in

我很难在CodeIgniter上链接我的css和js文件。我是codeigniter的新手,需要一些帮助。我在寻找,但找不到真正有效的解决办法。我的文件夹结构如下:

-> system
-> application
-> js
  -> jquery.js
-> css
  -> style.css
-> images
-> .htaccess
-> index.php
我的基本url就像在子域上工作一样

这是我给出的pass out/index.php/controller的.htaccess文件,因为我不知道它是否会影响问题

RewriteEngine on
RewriteCond $1 !^(index\.php|images|stylesheets|scripts|robots\.txt)
RewriteCond {REQUEST_FILENAME} !-f
RewriteCond {REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
这里是我的header.php-我使用一个简单的模板结构,页眉内容页脚加载

   <?php 
    $css = array(
          'href' => 'css/style.css',
          'rel' => 'stylesheet',
          'type' => 'text/css',
          'media' => 'screen'
        );
        echo link_tag($css);

    ?>
    <link rel="stylesheet" href="<?php echo base_url();?>css/style.css" />
    <script src="<?php echo base_url(); ?>js/jquery.js" type="text/javascript"></script>

当我点击它,它必须显示代码,其中我的文件内,但它显示404未找到。感谢您的帮助。

删除此行,然后重试一次:

RewriteCond $1 !^(index\.php|images|stylesheets|scripts|robots\.txt)
或者改用这个:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L] 
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]