Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
can I install FUelPHP in sub-URI
  • I have an app located in http://www.perpustakaan.xx.ac.id
    Can I install FuelPHP app located in http://www.perpustakaan.xx.ac.id/addon
    can I somehow do that..,

    I Try to change index.php from 
    //original index.php
    define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR);
    define('APPPATH', realpath(__DIR__.'/../../fuel/app/').DIRECTORY_SEPARATOR);
    define('PKGPATH', realpath(__DIR__.'/../../fuel/packages/').DIRECTORY_SEPARATOR);
    define('COREPATH', realpath(__DIR__.'/../../fuel/core/').DIRECTORY_SEPARATOR);

    into 
    define('DOCROOT', __DIR__.DIRECTORY_SEPARATOR);
    define('APPPATH', realpath(__DIR__.'/../../../fuel/app/').DIRECTORY_SEPARATOR);
    define('PKGPATH', realpath(__DIR__.'/../../../fuel/packages/').DIRECTORY_SEPARATOR);
    define('COREPATH', realpath(__DIR__.'/../../../fuel/core/').DIRECTORY_SEPARATOR);


    I can access the homepage, but not the other URL. 

    did I miss some setup ???
    thanks
  • Yes, you can.

    Have you followed all instructions from http://fuelphp.com/docs/installation/instructions.html#/install_inside_root ?

    So your addon folder now contains your index.php and the .htacess, and there is no more public directory?
  • public folder is deleted, but I dont understand about .htaccess
    the docs says that I should put .htaccess in one higher folder 
    so I do
    -fuel --> the apps folder
    -www
    -www/html  --> I create .htaccess here as documented in docs
    -www/html/addon --> every file inside public folder, including original .htaccess
    -www/html/"another-running-apps"


  • Yes correct, so the addon folder should contain both your index.php and your .htaccess, both were originally in public.

    If you request /addon/admin, it will generate a not-found, and your htaccess rewrite rules will pick it up and rewrite it to index.php.

    If that doesn't happen, it could be that your htacess isn't picked up at all. This can be tested very easily, by making a syntax error in it (just add a blank line with a random letter), if you get a 500 server error when you request the root of your site, your htaccess works. If the page loads, your htaccess file is ignored.
  • Just double checked here, I have dozens of sites running like this on my laptop for test purposes. For all I just copied the public folder contents and changed the paths in index.php, nothing more.
  • I try to test by making syntax error.., but it seems that htaccess is ignored. 
    I try to search on google how to activate it.., and most of them say that I just need to add RewriteEngine On. 

    for temporary, I can add index.php to wherever link or controller need to redirect. But it feels "weird" :P
       while I try to search for solution, but @Harro can you give some advice
    :)
    thanks
  • If your htaccess is ignored, check http://smartwebdeveloper.com/apache/htaccess-problems for possible solutions.

    On any modern apache installation, it's probably the AllowOverride that isn't correct.

Howdy, Stranger!

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

In this Discussion