2012-04-25 67 views
0

我是Apache环境的新手。我最好不要.htaccess文件,但我认为我没有选择。我的应用程序在使用WAMPSERVER的Windows环境下的笔记本上运行时没有问题。但是当我部署到使用Apache的托管服务器时,我遇到了一些问题。我不确定以下结构对于CodeIgniter应用程序是否正确。以下是托管服务器的目录结构...子域中的多个CI应用程序

httodocs/ 
/survey 
    /admin 
      /config   <-- $route['default_controller'] = "admin"; 
      /controllers 
      /models 
      /views 
      /... 
    /statistic 
      /config   <-- $route['default_controller'] = "statistic"; 
      /controllers 
      /models 
      /views 
      /... 
    /mySurvey 
      /config   <-- $route['default_controller'] = "mySurvey"; 
      /controllers 
      /models 
      /views 
      /... 
    /css 
    /images 
    /scripts 
    /system 
    /... 
/index.php     <-- $application_folder = 'mySurvey'; 
/admin.php     <-- $application_folder = 'admin'; 
/Statistic.php    <-- $application_folder = 'statistic'; 

我所做的只是复制应用程序文件夹,并分别重新命名为管理,统计和mySurvey,我设置的默认控制器如上所述。

所有的应用base_url() = 'http://survey.myhost.com'这是下myhost.com

根index.php文件实际上是CI应用环境允许时,他们输入“http用户在默认情况下,去mySurvey应用子域://调查.myhost.com”。

从第一页,当我访问http://survey.myhost.com/index.php/mySurvey/index/0 我得到错误:

`The specified CGI application misbehaved by not retruning a complete set of HTTP headers.` 

,当我访问http://survey.myhost.com/admin.php/admin/loginhttp://survey.myhost.com/statistic.php?statistic/chart/1(请注意,我也确实使用查询字符串我的应用程序)相同的消息显示

显然,这些都与路线有关。我在服务器上没有任何.htaccess文件,因为WAMP不需要它,请注意,如果有人能建议我在哪里可以放置.htaccess文件,以及上述结构的正确模式重写是什么,并且此结构是否合适。

问候,

KK吉安

回答

0
root 
    /subs 
    /survey (survey.domain.tld) 
     /application (CI application folder) 
     /config 
     /models 
     ... 
     index.php (CI index.php file) 
    /statistics 
     /application (CI application folder) 
     /config 
     /models 
     ... 
     index.php (CI index.php file) 
    /mySurvey 
     /application (CI application folder) 
     /config 
     /models 
     ... 
     index.php (CI index.php file) 

    /system (CI system folder) 
index.php

(潜艇/调查/ index.php文件,潜艇/ mysurvey/idnex.php,潜艇/统计/ index.php的),你将链接在root/system/文件夹,以便

$system_path = '../../system'; 

现在你可以很容易地去survey.myhost.com,statistics.myhost.com等删除的index.php,从URL字符串admin.php的($config['index_page'] = '';

希望我得到了你想要的东西

sorry for my english

+0

亲爱@MireSVK,谢谢您的回复和建议。您的建议是将每个应用程序放入不同的子域。这不是我想要的。基于我原来的想法,我只需要1个子域,即survey.myhost.com。统计和管理'模块'在里面。我希望你能理解我的问题。 – Gian 2012-04-26 01:27:47

+0

对不起,我会在稍后(今天)寻找一些解决方案。如果解决方案很好,我会在这里发布。现在,尝试插入行'header('Content-type:text/html');'到index.php,staticists.php和admin.php的某处。通过FireBug(FF)或DragonFly(Opera)在HTTP标头(响应)中寻找一些缺失的标题数据。 – miro 2012-04-26 05:50:47

相关问题