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: