Codeigniter删除索引并添加css [英] Codeigniter Remove index and add css

查看:123
本文介绍了Codeigniter删除索引并添加css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好这是我的网站链接
http://webscarlets.com/ci/welcome

Hi This is my website link http://webscarlets.com/ci/welcome

我是codeigniter的新人。我从url中删除了index.php。
要从url中删除index.php,我使用了以下代码。我从codeigniter用户指南获取这个代码

I'm new to codeigniter. I removed the index.php from the url. To remove the index.php from url i used the following code. I get this code from the codeigniter user guide

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

但是css没有加载。这是我的配置设置

But the css is not loading. Here is my configuration settings

//autoload.php
$autoload['helper'] = array('url','form','html');

//config.php   
$config['base_url'] = 'http://webscarlets.com/ci/';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

//constants.php
define("LAYOUT_URL","http://webscarlets.com/ci/");

//view.sphp 
<link rel="stylesheet" type="text/css" href="<?php echo LAYOUT_URL; ?>css/all.css">

请查看我的代码和指南以完成此任务。

Please review my codes and guide to complete this task.

感谢所有人。

推荐答案

此时css链接为 http:// webscarlets .com / ci / application / css / all.css ,因此请确保在此路径上放置了css文件或将css文件放在根文件夹上,并使用< link rel = type =text / csshref =<?php echo base_url;?> css / all.css> 而不是布局网址。

At the moment css link is http://webscarlets.com/ci/application/css/all.css so make sure there is css files is placed on this path or put css file on root folder and use <link rel="stylesheet" type="text/css" href="<?php echo base_url; ?>css/all.css"> instead of Layout url.

这篇关于Codeigniter删除索引并添加css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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