1

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!

Erebus
  • 1,998
  • 2
  • 19
  • 32
  • Please check this link > http://stackoverflow.com/questions/11245391/cakephp-2-0-setup-on-online-shared-hosting/16784774#16784774 – Siraj Khan May 30 '13 at 12:55

1 Answers1

1

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
  • 5,180
  • 7
  • 40
  • 47
  • Right, but how could that work? I only have access to one folder up from public_html. – Erebus Jan 28 '10 at 00:03
  • 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 Jan 28 '10 at 02:59
  • 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 Jan 28 '10 at 06:28
  • 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. – jbrass Jan 30 '10 at 18:40
  • "What goes in public_html is the webroot directory." WOW this is so trivial but not documented at all in the cookbook. I spend more than 4 hours looking for that ! – Guillaume Massé Mar 03 '11 at 06:59