这是我的引用css的代码
- news news
这是我的config.php的文件
$config['base_url'] = 'http://127.0.0.1/myphpstudy/index.php/';
这是生成页面后的源代码,点击href连接显示404,我怀疑可能路径错误,可是我不知道哪里错了
create a news item - news newscreate a news item title
text
wsdfsfdsa
我的css文件夹和header.php页面都是在news文件夹下面的,不知道到底哪里错了,请大牛指点啊,本人是刚刚接触php的
回复讨论(解决方案)
这是有效地路径吗?
难道 index.php 是目录?
$config['base_url'] = 'http://127.0.0.1/myphpstudy/index.php/';
是路径
试试?
试试?
不行啊
href=这个在页面上打印出来的连接发出来看看
href=这个在页面上打印出来的连接发出来看看
href=http://127.0.0.1/myphpstudy/index.php/css/yangshi.css />
item('base_url'));?>css/yangshi.css />
item('base_url'));?>/css/yangshi.css />
item('base_url'));?>/css/yangshi.css />
这个也不行啊 贴出的的目录结构
并指出你的文件的位置
在网站直接输入http://127.0.0.1/myphpstudy/index.php/css/yangshi.css能访问吗?是不是css这个目录限制访问的?
在网站直接输入http://127.0.0.1/myphpstudy/index.php/css/yangshi.css能访问吗?是不是css这个目录限制访问的?
显示404 page not found
贴出的的目录结构
并指出你的文件的位置
执行的文件为 myphpstudy/index.php
样式表在 myphpstudy/application/css 中
所以样式表的路径应为
dirname($this->config->item('base_url')) . '/application/css/'
执行的文件为 myphpstudy/index.php
样式表在 myphpstudy/application/css 中
所以样式表的路径应为
dirname($this->config->item('base_url')) . '/application/css/'
这个也不行,这个连接点开后是404 page not found
我在myphpstudy下面加上.htaccess文件,然后访问就会出现internal server error
rewriteengine on
rewriteengine on
rewritecond $1 !^(index\.php|images|css|robots\.txt)
rewriterule ^(.*)$ /index.php/$1 [l]
谢谢你们,问题已经解决了,是wampserver下面的一个配置文件出错了