我真的不明白为什么我的css和js文件没有加载 [英] didn't really understand why my css and js files are not being loaded

查看:113
本文介绍了我真的不明白为什么我的css和js文件没有加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!!!!

我正在使用PHP的CodeIgniter框架来开发一个小网站。我正在使用twitter bootstrap 3.0来美化网站。我在理解我的bootstrap文件的异常行为时面临一些严重的问题。有时它们会被装载,有时却不会装载。



当我使用URL localhost / money_tracker / index.php / login / bootstrap正确加载时localhost / money_tracker /没有加载任何bootstrap文件。

[注意:我已将路由文件中的默认控制器设置为登录。]



如果选中,则有时会显示404文件未找到其他时间它说403 Forbidden。



我甚至将包含引导程序文件的文件夹的权限更改为777.



我是新手网页编程。

Hello!!!!
I am using PHP's CodeIgniter framework to develop a small website. I am using twitter bootstrap 3.0 to beautify the website. I am facing some serious issues in understanding the anomalous behavior of my bootstrap files. Sometimes they get loaded and sometimes they don't.

when I use the URL localhost/money_tracker/index.php/login/ bootstrap gets loaded properly where as localhost/money_tracker/ doesn't load any bootstrap file.
[Note: I've set my default controller in route file a login.]

When checked sometimes it says 404 File not found whereas some other time it says 403 Forbidden.

I even changed the permission of the folder containing bootstrap files to 777.

I am new to web programming.

推荐答案

虽然你的问题很模糊,但我会根据你的问题理解答案。您可能想尝试删除您网址上的 index.php 。按照以下简单步骤:



1.打开 config.php ,可在应用程序文件夹中找到。

2.删除
Though your question is very vague, I will answer based on what I have understood from your question. You might want to try removing index.php on you url. Follow these simple steps:

1. Open config.php which can be found on the application folder.
2. Remove index.php on

上的 index.php

config ['index_page'] ='index.php';

3.在应用程序文件夹之外。您可以找到 .htaccess 文件。编辑它并用以下内容替换内容:



config['index_page'] = 'index.php';
3. Outside your application folder. You can find an .htaccess file. Edit it and replace the contents with:

<ifmodule mod_rewrite.c="">
    RewriteEngine On
    RewriteBase /<codeigniter-folder-name-here>/

    #Removes access to the system folder by users.
    #Additionally this will allow you to create a System.php controller,
    #previously this would not have been possible.
    #'system' can be replaced if you have renamed your system folder.
    RewriteCond %{REQUEST_URI} ^system.*
    RewriteRule ^(.*)


/index.php?/
/index.php?/


这篇关于我真的不明白为什么我的css和js文件没有加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆