【问题标题】:get internal server error 500 while adding external css file添加外部 css 文件时出现内部服务器错误 500
【发布时间】: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]

【问题讨论】:

标签: php twitter-bootstrap .htaccess codeigniter


【解决方案1】:

也从您的$config['base_url'] 中删除index.php,因为您的重写规则会从网址中删除index.php。因此,仍然将其包含在基本 url 中是没有意义的。
我猜你的问题是因为你没有启用 mod_rewrite。 重写规则需要 Apache 模块 mod_rewrite

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-03-09
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-05-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多