codeigniter 404找不到资产加载

codeigniter 404找不到资产加载

问题描述:

我被困在一个问题上几个小时,我无法摆脱它,我试图从我的资产文件夹加载我的引导文件,但我得到了404错误。codeigniter 404找不到资产加载

正如你可以看到我的资产文件夹在我的根文件夹

enter image description here

我BASE_URL功能在头叫它:

<link href="<?php echo base_url('assets/css/bootstrap.css'); ?>" rel="stylesheet"> 

而且我在我的控制台得到这个错误:

GET http://127.0.0.1/WeBusy/assets/css/bootstrap.css

GET http://127.0.0.1/WeBusy/assets/js/bootstrap.min.js 404(未找到)

编辑

我注意到,相关文件都失败,例如,如果我的自动加载库会议,我有这样的错误:

Message: mkdir(): Invalid path 
Filename: drivers/Session_files_driver.php 

Message: Session: Configured save path '' is not a directory, doesn't exist or cannot be created. 
Filename: C:\Users\User\Dropbox\WeBusy\system\libraries\Session\drivers\Session_files_driver.php 
+0

你怎么去? – user4419336

我想你已经离开了自己的基本网址空白

$config['base_url'] = ''; 

更改为

WARNING: You MUST set this value! 

$config['base_url'] = 'http://localhost/WeBusy/'; 

如果您正在使用CI3版本必须设置

您可能需要的index.php

<link href="<?php echo base_url('index.php/assets/css/bootstrap.css'); ?>" rel="stylesheet"> 
+0

不,我的基地址设置为'$ config ['base_url'] ='http://127.0.0.1/WeBusy/';'我不需要使用index.php,因为我在.htaccess中有这个: RewriteCond%{REQUEST_FILENAME}!-d RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%RewriteCond $ 1!^(index \ .php | assets | robots \ .txt | favicon \ .ico) RewriteCond%{REQUEST_FILENAME}!-d RewriteRule ^(。*)$ index.php/$ 1 [L] ' –

+0

而不是IP地址把本地主机放在'$ config ['base_url'] ='http:// localhost/WeBusy /';' – user4419336

+0

已经完成,这不会改变任何东西 –

访问它像这样使用:

<link href="<?php echo base_url(); ?>assets/css/bootstrap.css" rel="stylesheet">