Codeigniter在子域上安装时无法找到模型

时间:2015-04-18 20:00:41

标签: php codeigniter routing

我在XAMPP中创建了我的应用程序,它工作正常,现在当我将它移到我网站的子域上时。当我尝试打开应用程序的登录页面时,会出现错误Unable to locate the model you have specified

子域名目录结构:

public_html/
           Subdomain/
                     Codeigniter/
                                 application/
                                           models/
                                           views/
                                           controllers/

我的Codeigniter应用程序的登录页面是:

在本地主机上

http://localhost/INvoice/index.php/admin/Login_Controller/

在网站上

http://subdomain.example.com/index.php/admin/Login_Controller/

2 个答案:

答案 0 :(得分:0)

在xampp for codeigniter中我使用这个htaccess与windows 7& 8。

Options +FollowSymLinks
Options -Indexes

<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
    Order deny,allow
    Deny from all
</FilesMatch>

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

我在live上使用子域,并且htaccess工作正常,只要它位于子文件夹和父目录的主目录中。我想是因为你否认所有引起你问题的事情。

主要目录

enter image description here

Sub Dir演示

enter image description here

答案 1 :(得分:0)

我弄明白了这个问题。基本上我在模型的文件命名约定中遇到问题。我一直在文件名中使用大写字母,即Login_Model.php,当我将其更改为login_model.php时,它是固定的。 只是要知道,我的.htaccess仍然是空的,但我的网址没有问题。