2012-03-01 196 views
2

我遇到安裝cakephp應用程序到託管公司這是運行zeus服務器的麻煩。它在我的apache上運行正常,但由於我無法控制的原因,我必須將其轉移。cakephp宙斯服務器

我在應用程序中丟失控制器。我把它叫做OSM

Error: Create the class LoginController below in file: app/Controller/LoginController.php 

子目錄我把rewrite.script在應用程序中,app文件夾,Web根目錄的根目錄。這允許訪問控制器和登錄,但所有的CSS,JS失蹤。

所以我註釋掉在core.php中

Configure::write('App.baseUrl', env('SCRIPT_NAME')); 

行現在,我不能讓訪問控制器,但我有CSS和JS了。

無法看到我從我看到的例子中缺少的東西。

如果我現在在URL中使用的index.php它的工作 http://www.mydomain.com/osm/index.php/login

rewrite.script:

# 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: 

回答