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.
Related
Hello community I want to Create custom sitemap in root/public_html directory and i want to view as raalic.us/sitemap.xml
So how can i access root directory any file or specific file in cake php?
You have set the cakephp based web app to root/public_html
CakePHP has its own root directory and it is called webroot
.htaccess redirects all http requests to that directory
it contains publicly available files (css, js, img, ..)
you can put your sitemap.xml in it
so the correct path to the xml file is: root/public_html/webroot/sitemap.xml
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
How to install app in a subdirectory of another app?
For example, if it is the main app folder structure:
/app/Config
/app/Controller
/app/Model
/app/webroot
...
I want to put the second app files in a directory named 'client', so new structure should be:
/app/Config
/app/Controller
/app/Model
/app/webroot
/app/client/Model
/app/client/webroot
...
and if first app url is http://example.com, the second one should be http://example.com/client
I tried putting some files in client folder, but cake thinks its one of its controllers and try to find its action. (so 404 error occurred)
You can fix this problem in your default CakePHP installation.
You can use a 'client' prefix and in the your default controller you can add the method 'client_index'
Look here:
http://book.cakephp.org/2.0/en/development/routing.html#prefix-routing
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.
How do I set AllowOverride on NearlyFreeSpeech.net? I'm trying to follow the instructions at Within cakePHP, In my routes.php only the '/' (base path) works. Any other url is 404 page not found to resolve the problems described therein.
So far, I've had to do the following when moving out of a WAMP development environment:
Refer to controller names by their correct case
Change the name of the server in the configuration file
Add all the CakePHP-related files to the web group
The solution is as follows:
Copy the files over from your working environment (or do an export from your source control tool) into a new folder on NearlyFreeSpeech.net (NFS.net). Let's call the new folder "abc".
Import your database into NFS.net.
Configure database settings as necessary on the NFS.net version of the site.
Add the abc folder and everything in it to the web group.
Go into the .htaccess file in /home/public/abc and add "RewriteBase /abc" under "RewriteEngine on".
Add "RewriteBase /abc/app" to the .htaccess in /home/public/abc/app and add "RewriteBase /abc/app/webroot" to the one in /home/public/abc/app/webroot.