用户
 找回密码
 入住 CI 中国社区
搜索
查看: 1675|回复: 3
收起左侧

[HELP] 加载静态内容--折腾2天还是不行

[复制链接]
发表于 2015-4-23 02:27:43 | 显示全部楼层 |阅读模式
加载静态内容--折腾2天还是不行

config.php
$config['base_url'] = 'http://网址/';

/application/controllers/pages.php
/application/views/templates/header.php
/application/views/templates/footer.php
/application/views/pages/home.php
/application/views/pages/about.php

一个都没漏下,全传上去了
http://网址/index.php/pages/view
显示:
                404 Page Not Found                The page you requested was not found.

routes.php设置为:

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
$route['default_controller'] = 'pages/view';
$route['(:any)'] = 'pages/view/$1';

http://网址/iindex.php/about
仍然不行

       

我用的是bluehost 空间,在根目录安装的Codeigniter
不知道为什么,请高手指点,谢谢!!!

下面是空间的配置
PHP Version 5.4.39
System Linux box752.bluehost.com 3.12.32.1415814620 #1 SMP Wed Nov 12 11:53:28 CST 2014 x86_64
Build Date Mar 25 2015 14:19:59
Server API CGI/FastCGI
Virtual Directory Support disabled
Configuration File (php.ini) Path /usr/php/54/etc
Loaded Configuration File /usr/php/54/etc/php.ini
Scan this dir for additional .ini files /usr/php/54/etc/php.d
Additional .ini files parsed (none)
PHP API 20100412
PHP Extension 20100525
Zend Extension 220100525
Zend Extension Build API220100525,NTS
PHP Extension Build API20100525,NTS
Debug Build no
Thread Safety disabled
Zend Signal Handling disabled
Zend Memory Manager enabled
Zend Multibyte Support provided by mbstring
IPv6 Support enabled
DTrace Support disabled
Registered PHP Streamshttps, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transportstcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filterszlib.*, bzip2.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk



发表于 2015-4-23 09:03:38 | 显示全部楼层
这跟加载静态内容没有关系,跟你写的CI有关系。找错了方向。
 楼主| 发表于 2015-4-23 21:35:10 | 显示全部楼层
本帖最后由 james111 于 2015-4-24 00:15 编辑

我只是在实验教程里的加载静态内容

config.php 修改如下(CI在根目录)
$config['base_url'] = 'http://网址/';

下面的文件均放进去了
/application/controllers/pages.php
/application/views/templates/header.php
/application/views/templates/footer.php
/application/views/pages/home.php
/application/views/pages/about.php

这样打开出404错误
http://网址/index.php/pages/view

请指点,谢谢!
 楼主| 发表于 2015-4-24 03:11:16 | 显示全部楼层
这个贴帮了我 “新手注意,linux下类名必须和文件名一致区分大小写,如果class Pages,那文件名必须是Pages.php,居然被这个问题困了那么久,我真是。。。”
谢谢!

本版积分规则