Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
My fuel install
  • Okay, first and foremost I came to fuel because CI is mostly dead, and what's left of it is just a whisper of what it could be. Anyway, on to the topic at hand. I have a webhost situation where installing fuel outside the webroot is just not practical. I decided out of the kindness of my heart to share my .htaccess with those of you who are stuck in a similar situation to make things a little easier on you.
    <IfModule mod_rewrite.c>
     RewriteEngine on
     # rewrite everything using the public dir
     RewriteBase /public
     # if nothing was called, use index.php
     RewriteRule ^(/)?$ index.php/$1 [L]
     # exclude directories from direct calling
     RewriteCond %{REQUEST_URI} ^/(fuel|cgi-bin|stats)/(.*)$
     RewriteRule ^(.*)$ index.php/$1 [L]
     # redirect asset requests
     RewriteCond %{REQUEST_URI} ^/(assets)/(.*)$
     RewriteRule ^(.*)$ $1 [L]
     # if all else fails, and file still does not exist, process through index.php
     RewriteCond %{REQUEST_FILENAME} !-f
     RewriteCond %{REQUEST_FILENAME} !-d
     RewriteRule ^(.*)$ index.php/$1 [L]

    I also had to remove the .htaccess from my fuel directory for this to work. you can add other directories to the query by using | and adding them inside the parenthesis along with fuel. If you have an .htaccess in the fuel directory or any of it's subdirectories, it will override the base htaccess, which is why you must remove them first. With this, apache will treat the fuel directory as if it doesn't exist. you may note the cgi-bin and stats directories, those are on my test server, if you don't have those directories, or want to grant access to those directories, you can remove those. there is the added benefit that if an asset does not exist, it will still process through index.php.

Howdy, Stranger!

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