Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
how to routing without index.php
  • routing without index.php


    config.php
        'index_file'  => false,

    routes.php
        'home' => 'member/home',
        'login' => 'member/login',
        'trading' => 'member/trading',
        'logout' => 'member/logout',

        '_root_'  => 'member/index',  // The default route
        '_404_'   => 'welcome/404',    // The main 404 route
        
        
    member controller (controller class named as member)
    - has public functions with associated views in the views/member folder

        public function action_home()
        {
            $view = View::forge('member/home');
            
            'do stuffs
            
            $this->template->content = $view;
        }


    README.md *Version 1.2    

    behavior
    1. when site is loaded for the first time (http://host/site/public/), it works and the home page loads showing the home view.
    2. when browser refresh is clicked, it works. the home page refreshes. url still the same as above.
    3. when url is encoded in the browser address bar as "http://host/site/public/index.php/member/home" it works. i noted that when i debug the Uri::main(), i get "http://host/site/public/member/home".
    4. but when i use this address "http://host/site/public/member/home" in the browser address bar, it does not work anymore(the browser gets a page Not Found error). any straight forward example on how to configure my codes to remove the index.php in the urls? i am new to configuring urls.


    Thanks in Advance.
        

  • The default FuelPHP installation is not meant to be installed inside the docroot, or a folder of the docroot, as you have installed it. This means you'll have to adjust the .htacess to your environment.

    See http://docs.fuelphp.com/installation/instructions.html#/configuration for some pointers...
  • ahh... so thats the reason. thank you so much sir. i will surely look into the link for more pointers.

Howdy, Stranger!

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

In this Discussion