我有困难安装一个cakephp应用程序到一个托管公司,这是运行一个宙斯服务器。它在我的apache上运行得很好,但是由于我无法控制的原因,我不得不传输它。
我在应用程序中失去了控制器。我把它放在一个名为osm的子目录中
Error: Create the class LoginController below in file: app/Controller/LoginController.php我把一个rewrite.script放在应用程序的根部,应用文件夹,webroot。这允许访问conrollers和登录,但是所有的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:发布于 2012-03-04 01:33:06
看看这个在宙斯上使用CakePHP
https://stackoverflow.com/questions/9522792
复制相似问题