Simple problem with mod_rewrite in the Fat Free Framework

前端 未结 7 2442
悲哀的现实
悲哀的现实 2020-12-18 02:42

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 usi

相关标签:
7条回答
  • 2020-12-18 03:12

    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.

    0 讨论(0)
提交回复
热议问题