2016-12-16 54 views
0

我试图用一个自举模板为我笨项目,但我有麻烦集成自举模板。我下面的教程,他把这个内容.htaccess文件:我不能笨

RewriteEngine on 
RewriteCond $1 !^(index\.php|images|css|fonts|js|robots\.txt) 
RewriteRule ^(.*)$ /index.php/$1 [L] 

但我有我的.htaccess文件与此内容:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    # !IMPORTANT! Set your RewriteBase here and don't forget trailing and  
    leading 
    # slashes. 
    # If your page resides at 
    # http://www.example.com/mypage/test1 
    # then use 
    # RewriteBase /mypage/test1/ 
    RewriteBase /ci_introo/ 

    RewriteCond %{REQUEST_URI} ^system.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    RewriteCond %{REQUEST_URI} ^application.* 
    RewriteRule ^(.*)$ /index.php?/$1 [L] 

    #RewriteCond $1 !^(index\.php|public|\.txt) 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteRule ^(.*)$ index.php?/$1 [L] 
    </IfModule> 

    <IfModule !mod_rewrite.c> 
    # If we don't have mod_rewrite installed, all 404's 
    # can be sent to index.php, and everything works as normal. 
    # Submitted by: ElliotHaughin 

    ErrorDocument 404 /index.php 
    </IfModule> 

我该如何解决这个问题?

+0

你不能使用模板是指?你不能在codeigniter中引用css和js的引导程序。是吗???? – kishor10d

+0

我不能使用背景图片从引导了我的主页@ kishor10d –

+0

我无法理解为什么你写这么大的'''.htaccess'''而你并不需要那么多的代码。 – kishor10d

回答

0

您需要自动加载的配置文件的URL帮手。

转到application/config/autoload.php

找到这个$autoload['helper'] = array();

,并改变了这一点。

$autoload['helper'] = array('url');

+0

我已经完成了这项操作.. –

+0

那么结果是什么呢然后又是致命的吗? – kishor10d

+0

是的还没有工作 –

0

你不需要为的.htaccess。 所有你想要做的就是在你的autoload.php

添加URL,并将其放置在您的head.php

application/views/head.php

<html> 
<head> 
<link rel="stylesheet" href="<?php echo base_url();?>assets/css/bootstrap.min.css" /> 
    //place all css u need 
    </head> 

控制器代码:

$this->load->view('header', $data);