cakephp: configuring cakephp on shared host justhost - cakephp

I tried to configure cakephp on justhost for my addon domain and i'm getting 404 not found error when I go to www.merryflowers.com/pages/home
Can someone please help me out?
The following are the changes I made in /webroot/index.php and /webroot/test.php
if (!defined('ROOT')) {
define('ROOT', DS.'home'.DS.'xxx'.DS.'public_html');
}
if (!defined('APP_DIR')) {
define('APP_DIR', 'merryflowers');
}
if (!defined('CAKE_CORE_INCLUDE_PATH')) {
define('CAKE_CORE_INCLUDE_PATH', DS.'home'.DS.'xxx');
}
Do I need to make some changes to the .htaccess file? and .htaccess file from which folder?
under public_html/merryflowers.com/ i have:
views, plugins and webroot folder
thank you

It seems mod_rewrite isn't functioning properly, I can access the webrootdirectory (http://www.merryflowers.com/webroot/), which states that core.php can't be found. Before you look into possible mod_rewrite problems, ensure core.php is properly included.
I'm not sure you need to set all the paths in index.php, setting CAKE_CORE_INCLUDE_PATH might be enough.
You're full path isn't DS.'home'.DS.'xxx', but:
DS.'home'.DS.'xxx'.'public_html'.DS.'merryflowers.com'
You might want to set ROOT and APP_DIR to the default values, unless you need custom paths.

Related

cakephp access cs and js files inside webroot folders

I am getting a problem in deploying my app to the server. The problem is i have folders inside the webroot which points to the .css and .js files.
I was doing the basic cakephp function $this->Html->css('bootstrap') when my simple css files were in the css folder but now there are some other folders inside the webroot because of using the plugins for the frontend UI.
For this i have changed my url to like this $this->Html->css('/global/plugin/file')
Problem is on local it is working fine because of virtual host example.com but on live server i have domain like this 192.168.00.00/mysite so it go to the main directory to and link the ip 192.168.00.00 instead of going to 192.168.00.00/mysite.
Is there any good way to solve this and add the flexibility to the url so that my local and live will not be disturbed while i push my code through git?
Just removes '/' from $this->Html->css('/global/plugin/file') to below
<?php
$this->Html->css('global/plugin/file');
$this->Html->script('global/plugin/file'); //example loading file.js
?>
I already had an issue about this one including my JS and CSS inside a folder but when I removed '/' it solve my problem.
Confirm that their is a file.css inside plugin inside webroot\css\global\plugin\file.css windows path or LINUX path /webroot/css/global/plugin/file.css

No css and images getting applied in cakephp 1.3 for iis

I am trying to use IIS for CakePHP 1.3 but no CSS and images are getting applied to it.
Make sure you have all .htaccess file in place.
Cakephp request is trying to get the css file from css folder but it is enable to have the proper path, .htaccess files in place to route it to the webroot and not to a controller!
Also check if mod_rewrite is enabled.
SEE HERE.

CakePHP Subcake Redirect

I have a problem with CakePHP (1.3) project, i need to create projects inside the same domain/hosting of other project, like this:
app
cake
plugins
templates
vendors
ADMINONE (Cake project files here)
ADMINTWO (another Cake project files here)
.htaccess
index.php
README
The problem is, when I put the CakePHP code inside ADMINONE or ADMINTWO to create the other cake projects, if I put the url http://domain.com/ADMINONE/, the URL redirects to http://domain.com or the cake read the /ADMINONE as a controller name.
How can I redirect this URL to the directory ignoring the primary directory cake's redirect?
Dont forget to change your index.php inside the webroot folder. In there you can set up the
APP_DIR and the ROOT if need be.

URL rewriting is not properly configured on your server

I tried upgrading my cakephp version from 1.3 to 2.5 but encountered an url rewriting problem. Another cakephp app runs on the same version so I'm sure the mod_rewrite works.
Although when I go to example.com/pages/home I get following error:
URL rewriting is not properly configured on your server. 1) Help me configure it 2) I don't / can't use URL rewriting
When I go to my normal home page and I want to click on a home link I get following url :
http://example.com/app/webroot/index.php/
And it is the same for other urls.
http://example.com/antwerp becomes http://example.com/app/webroot/index.php/antwerp
When I go to http://example.com/antwerp the site works as it should...
Any ideas where I've gone wrong?
I would suggest accessing your account and re-uploading your .htaccess files from and to the following locations respectivelly.
/app
.htaccess
/webroot
.htaccess
.htaccess
Some FTPs do not upload those files automatically until you force it to.
If that does not work, check if you have your php.ini file in your public_html folder of this application.

CakePHP: Set up a new project within another project

I've copied a homepage to the server, after a few problems with 1&1, if this matters, I've changed the .htaccess in the root, /app and /app/webroot directories. After
RewriteEngine on
I've included
RewriteBase /
to get it to work. However, beside the homepage itself, I've made an administration by adding a new CakePHP-project in the folder "Administration" which I've simply copied in the root-directory. Worked perfectly with XAMPP, but unfortunatly not with the 1&1-server. I've also tried to copy it in the app-folder, but visiting example.com/Administration will just give me an error, that says, the controller cannot be found.
Any ideas how I could access my administration?

Resources