无法访问codeigniter控制器在Live服务器,但在本地主机访问(XAMPP在Windows上) [英] Unable to access codeigniter controller in Live Server but accessible in localhost (xampp on windows)

查看:95
本文介绍了无法访问codeigniter控制器在Live服务器,但在本地主机访问(XAMPP在Windows上)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目在本地系统(XAMPP)工作正常,但是当上传到托管服务器它不工作。即时通讯使用codeigniter框架。在入店通过本地主机/ MyProject的/控制器本地主机,但主机服务器无法通过myproject.com/controller访问,甚至myproject.com/index.php/controller !!

My project working fine on local system (XAMPP) , however when uploaded to hosting server its not working. Im Using Codeigniter framework. accesible in localhost via "localhost/myproject/controller" , but in host server unable to access via myproject.com/controller or even myproject.com/index.php/controller !!

在服务器上,主域名是(让假设D.COM并添加域名AD.COM)。我的申请是根据附加域安装。因此,我的文件夹结构

On server, main domain is (lets suppose D.COM and add on domain is AD.COM). My application is installed under addon domain. hence my folder structure is

public html/
            AD.COM/
                  application/
                              Config
                              Controllers
                              Modules
                              Views
                  System/
                 User_guide/
                .htaccess

的.htaccess包含此code

.htaccess contains this code

DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA]

同时,也保持这些变量

Also maintained these variables

$config['base_url'] = '';
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';

如何解决这个问题。我尝试使用Google,但没有得到任何帮助。先谢谢了。

how to fix this. I tried googling but didnt get any help. Thanks in advance.

推荐答案

请约为 codeigniter命名转换关注并保持头脑的 Linux主机区分大小写

Please be concern about Codeigniter naming conversion and Keep mind Linux host is Case-Sensitive.

您不提供有关您的问题的任何资源。因此,必须告诉正在查看的拼写你的网址控制器名称方法的,你会进一步要求。

You are not providing any resources related to your question. So have to tell is check about Spellings of your url and controller names and methods which you will call further.

这篇关于无法访问codeigniter控制器在Live服务器,但在本地主机访问(XAMPP在Windows上)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆