Question

I am having trouble deploying my CakePHP application onto a shared web server. Here's what I've done:

1) I zipped the application from my local machine: application.zip 2) I then uploaded the zip file on to my public_html on the server and extracted it

So now my application sits at www.mydomain.com/application which works fine, but once I move the contents of the application folder onto public_html (so that my application sits at www.mydomain.com) it doesn't load the application properly. It only loads SOME of the links of the home page and none of the styles.

So to sum it up.. the app works fine right after extracting to public_html/application/ But once I move the contents of the application folder to public_html it doesn't work.

How am I supposed to set up the folder structure so that my application sits at www.mydomain.com?

Any help would be greatly appreciated.

Was it helpful?

Solution

I just happened to try deploying a Cake app in the same way to a shared server using CPanel and had exactly the same problem. What I discovered is that somehow (I think when I extracted the zip to the public_html directory there was an empty .htaccess file that didn't want to be replaced) the .htaccess file in the root of the application was empty.

Just make sure the .htaccess file in the root of your application (i.e. in public_html) contains this:

<IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteRule    ^$ app/webroot/    [L]
    RewriteRule    (.*) app/webroot/$1 [L]
</IfModule>

Worked fine for me and I'm all set now!

OTHER TIPS

You could also try deleting cache files in app/tmp/cache Not the folders but the files in the folders

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top