【问题标题】:Codeigniter project is not working after installing at cpanel在 cpanel 安装后 Codeigniter 项目无法正常工作
【发布时间】:2013-06-12 11:23:15
【问题描述】:

我构建了 codeigniter 项目,并在我的本地机器上使用http://works.dev/rcsoft 作为基本 url 对其进行了测试。我将该项目上传到 cpanel 和我的新网址,如http://testsomeone.org/rcsoft。主页正在运行。

但它不适用于其他控制器页面,例如http://testsomeone.org/rcsoft/person。它给了

Not Found

The requested URL /index.php/person was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

但它适用于http://testsomeone.org/rcsoft/index.php/person

我的 .htaccess 文件

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L,QSA]

我的 config.php

$config['base_url'] = 'http://testsomeone.org/rcsoft/';
$config['index_page'] = '';

请帮助我。问题是什么?

【问题讨论】:

    标签: codeigniter .htaccess codeigniter-2 cpanel


    【解决方案1】:

    它在您的本地机器上工作正常吗?..如果是这样,那么只需更改路由文件中的详细信息..然后尝试..

    【讨论】:

    • 是的。它适用于我的本地机器。还有 localhost/rbsoft。路由文件未更改,默认控制器设置为 home。
    【解决方案2】:

    首先打开application/config/config.php文件并编辑第17行,如下例:

    $config['base_url'] = 'http://testsomeone.org/rcsoft/';
    

    其次,在.htaccess 文件中的RewriteEngine On 之后插入以下行:

    RewriteBase /rcsoft/
    

    【讨论】:

    • 另一个 $config['index_page'] = '';
    猜你喜欢
    • 2017-12-09
    • 2017-07-16
    • 2012-08-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-18
    • 2016-06-10
    相关资源
    最近更新 更多