Php Codeigniter链接以加载不同的视图

Php Codeigniter链接以加载不同的视图,php,.htaccess,codeigniter,Php,.htaccess,Codeigniter,我不确定我在这里做错了什么。一切看起来都很好。但我在页面加载时不断出现错误500 <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); class Site extends CI_Controller { public function index() { $this->home(); } public function home()

我不确定我在这里做错了什么。一切看起来都很好。但我在页面加载时不断出现错误500

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Site extends CI_Controller {
    public function index() 
    {
        $this->home();
    }

public function home()
    {
        $this->load->view("header");
        $this->load->view("site");
        $this->load->view("footer");
    }

public function about()
    {
        $this->load->view("header");
        $this->load->view("about");
        $this->load->view("footer");
    }
}
想法?思想。我知道这很愚蠢。我已经有几个月没有做任何CI工作了

谢谢

1)您的CI文件夹是位于根文件夹中还是位于“站点”文件夹中

2) 如果在文件夹“site”中,请尝试使用mywebsite.com/site/your\u controller\u name/about 也可以尝试mywebsite.com/index.php/site/about或mywebsite.com/site/index.php/your_controller_name/about

我如何称呼它:mywebsite.com/CodeIgniter/Welcome/About

CI文件位于“CodeIgniter”文件夹中,这是my.httaccess的外观:

我发现了问题所在。是htaccess文件的问题

我必须这样做才能让它工作

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

谢谢

Plz检查文件名和文件夹结构about.php文件位于我的视图目录中。这也是我的site.php文件可以正常加载的地方。就在我想加载about.php文件时,我得到了一个奇怪的错误。我发现了问题所在。在本地使用WAMP,一切正常。但在我的托管公司(godaddy)上,它不起作用。有什么想法吗?有一件事500错误代码并不意味着文件不存在,如果文件不存在,它应该是404或400范围内的代码。如果可能是500范围,则需要进行服务器端配置。例如需要在php文件中分配内存等@menukadevinda对不起,我的不好,我刚醒来就发布了它。
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]