I am having trouble installing a cakephp app onto a hosting company this is running a zeus server. It is working fine on my apache, but for reasons outside of my control I have to transfer it.
I am getting missing controller in the app. I have it in a sub directory called osm
Error: Create the class LoginController below in file: app/Controller/LoginController.php
I put a rewrite.script in the root of the app, app folder, webroot. This allowed access to the conrollers and the login but all the css, js was missing.
So I uncommented the line in core.php
Configure::write('App.baseUrl', env('SCRIPT_NAME'));
Now I cant get access to the controllers but I do have the css and js now.
Cant see what I am missing from the examples I have seen.
if I now use index.php in the url it does work
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:
Have a look at this Using CakePHP on Zeus