Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Just began using, possible to get around having "public" in the URL
  • I created a new controller within fuel/app/classes/controller
    <?php
    class Controller_Add extends Controller {
      
     function action_index() {
       print 'howdy';
     }
    }
    ?>
    

    How do I create apps without having "public" being one of the URI segments? What is the public folder there for, for controller methods that can be accessed publicly? Sorry for all the ignorant questions - thank you.
  • As the documentation explains, the setup of Fuel is so that the public folder represents your webserver DOCROOT, and all fuel folder are one level up, outside of the DOCROOT, and inaccessable by the browser. If you don't want that, or you can't (because of for example shared hosting restrictions), you have to modify the rewrite settings. This is also documented: http://fuelphp.com/docs/installation/instructions.html#install_inside_root As always, RTFM... ;)
  • Thanks, so I have the recommended structure in place, but I am using mamp, maybe that has something to do w/ having to include the segment "public" w/i the URL. I'll just continue using "public' w/i the URL.
  • MAMP in the end is an apache installation like all others. Somewhere you'll have a virtualhost definition for your site, and in that definition a DocumentRoot statement with a path behind it, currently pointing to the web root of your fuel installation. All you have to do is add '/public' to that path. If you don't want to go that route, did you move the .htaccess supplied by Fuel in the public folder to your root folder? If not, Apache will not find it, and the RewriteBase won't work.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion