Simple problem with mod_rewrite in the Fat Free Framework
So my friend actually helped me out with this issue. I ran into the exact same problem, but basically I'm using MAMP also and have all my Fat Free files within a fatfree
dir within htdocs of MAMP.
The solution is you need to mod the RewriteBase
to point to /[dirname]/
instead of just /
and then change RewriteRule
to /[dirname]/index.php
.
My .htaccess looks like this:
RewriteEngine On
RewriteBase /fatfree/
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /fatfree/index.php [L,QSA]
After that's set, you can follow the example in the Fat Free doc exactly and it'll work like a charm. This stumped me for a while and this was all it needed. Also, if you're using MAMP, edit the httpd.conf
file in /Applications/MAMP/conf/apache
and be sure to alter the following:
<Directory />
Options Indexes FollowSymLinks
AllowOverride None
</Directory>
to
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
Basically change None
to All
.
If you're running F3 under a subfolder, you must change the RewriteBase in .htaccess to match the folder.