首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cakephp zeus服务器

cakephp zeus服务器
EN

Stack Overflow用户
提问于 2012-03-01 19:38:52
回答 1查看 238关注 0票数 2

我有困难安装一个cakephp应用程序到一个托管公司,这是运行一个宙斯服务器。它在我的apache上运行得很好,但是由于我无法控制的原因,我不得不传输它。

我在应用程序中失去了控制器。我把它放在一个名为osm的子目录中

代码语言:javascript
复制
Error: Create the class LoginController below in file: app/Controller/LoginController.php

我把一个rewrite.script放在应用程序的根部,应用文件夹,webroot。这允许访问conrollers和登录,但是所有的css、js都丢失了。

因此,我取消了core.php中的行注释

代码语言:javascript
复制
Configure::write('App.baseUrl', env('SCRIPT_NAME'));

现在我无法访问控制器,但我现在有css和js。

从我所看到的例子中看不到我错过了什么。

如果我现在在url中使用index.php,它确实可以工作 http://www.mydomain.com/osm/index.php/login

rewrite.script:

代码语言:javascript
复制
    # get the document root
    map path into SCRATCH:DOCROOT from /
    # initialize our variables
    set SCRATCH:ORIG_URL = %{URL}
    set SCRATCH:REQUEST_URI = %{URL}

    # see if theres any queries in our URL
    match URL into $ with ^(.*)\?(.*)$
    if matched then
      set SCRATCH:REQUEST_URI = $1
      set SCRATCH:QUERY_STRING = $2
    endif
    RULE_0_END:

    RULE_1_START:
    # prepare to search for file, rewrite if its not found
    set SCRATCH:REQUEST_FILENAME = %{SCRATCH:DOCROOT}
    set SCRATCH:REQUEST_FILENAME . %{SCRATCH:REQUEST_URI}

    # check to see if the file requested is an actual file or
    # a directory with possibly an index.  don't rewrite if so
    look for file at %{SCRATCH:REQUEST_FILENAME}
    if not exists then
      look for dir at %{SCRATCH:REQUEST_FILENAME}
      if not exists then
        set URL = osm/index.php?q=%{SCRATCH:REQUEST_URI}
        goto QSA_RULE_START
      endif
    endif

    # if we made it here then its a file or dir and no rewrite
    goto END
    RULE_1_END:

    QSA_RULE_START:
    # append the query string if there was one originally
    # the same as [QSA,L] for apache
    match SCRATCH:ORIG_URL into % with \?(.*)$
    if matched then
      set URL = %{URL}&%{SCRATCH:QUERY_STRING}
    endif
    goto END
    QSA_RULE_END:
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-03-04 01:33:06

看看这个在宙斯上使用CakePHP

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/9522792

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档