Simple problem with mod_rewrite in the Fat Free Framework

Posted by ian on Stack Overflow See other posts from Stack Overflow or by ian
Published on 2011-01-02T02:44:22Z Indexed on 2011/01/02 2:54 UTC
Read the original article Hit count: 211

Filed under:
|
|
|

I am trying to setup and learn the Fat Free Framework for PHP. http://fatfree.sourceforge.net/

It's is fairly simple to setup and I am running it on my machine using MAMP.

I was able to get the 'hello world' example running just fin:

require_once 'path/to/F3.php';
F3::route('GET /','home');
    function home() {
        echo 'Hello, world!';
    }
F3::run();

But when I try to add in the second part, which has two routes:

require_once 'F3/F3.php';

F3::route('GET /','home');
function home() {
    echo 'Hello, world!';
}

F3::route('GET /about','about');
function about()
{
    echo 'About Us.';
}

F3::run();

I get a 404 error if I try the second URL: /about

Not sure why one of the mod_rewrite commands would be working and not the other.

Below is my .htaccess file:

# Enable rewrite engine and route requests to framework
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]

# Disable ETags
Header Unset ETag
FileETag none

# Default expires header if none specified (stay in browser cache for 7 days)
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault A604800
</IfModule>

© Stack Overflow or respective owner

Related posts about php

Related posts about .htaccess