views:

174

answers:

1

Hello,

I've installed cakePHP on a shared server where I can't set the Apache webroot, so it's currently pointing to /public_html. In that folder I have /cake, /app, /vendors, etc. Everything works fine; the only problem is that rather than links to controllers/actions being www.mysite.com/controller/action, there is an addition /app/ in the URL, like this:

www.mysite.com/app/controller/action

I want to get rid of /app/ in my URL. Any suggestions? If you need anymore info (.htaccess files, etc.) let me know.

Thanks!

A: 

What goes in public_html is the webroot directory.

You should put cake outside public_html as well as the app directory. Then just edit webroot/index.php to the corresponding routes and you're done.

metrobalderas
Right, but how could that work? I only have access to one folder up from public_html.
Erebus
Yeah, that's it. Usually you have access to /home/erebus/, there you put cake and the app (without the webroot) /home/erebus/cake and /home/erebus/app and then you set the app/webroot dir in public_html.
metrobalderas
Yes, you are totally right. Here's a more detailed explanation from the cakePHP book for anyone who refers to this question later: http://book.cakephp.org/view/35/Advanced-Installation.Thanks!
Erebus
an additional note, dont put the webroot dir in the public_html folder, but put the contents of it in the public_html folder. You will have to tweek the index.php, but this is one of the best and most secure ways to set up a cake app.
bucho