【发布时间】:2016-05-21 07:43:46
【问题描述】:
我正在使用 codeigniter 和 bootstrap 3。问题是当我尝试在我的项目中添加 boostrap css 文件时出现错误。当我从下面的代码中删除链接标签时错误得到修复。为什么我得到这个错误以及我该如何解决这个问题?请帮帮我
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<link rel='stylesheet' type='text/css' href='<?php echo base_url("assets/css/bootstrap.min.css"); ?>' >
</head>
<body>
<h1>this is index</h1>
</body>
</html>
在我的 config.php 文件中,我添加了如下的基本网址
$config['base_url'] = 'http://localhost/mycodeigniter/ci/index.php';
并从以下内容中删除了 index.php
$config['index_page'] = '';
在根目录的 htaccess 文件中,我粘贴了以下代码以删除 index.php 表单 url
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
【问题讨论】:
-
这里不需要index.php
$config['base_url'] = 'http://localhost/mycodeigniter/'; -
试过 $config['base_url'] = 'localhost/mycodeigniter/ci/index.php' 错误依旧
标签: php twitter-bootstrap .htaccess codeigniter