1
votes

I am trying to run a php project with Fat-Free Framework on MAMP, running on Yosemite 10.10.1. I have all the project files in MAMP web root folder "htdocs" and all the fatfree project files are located within a fatfree-master dir.

The specific dir location is : htdocs/libs/FatFreeFramework/fatfree-master

I have succesfully imported a database into phpmyadmin.The size of it was 2.5mb but no errors flashed during the upload so i assume the size was not a problem at all!

I set up a virtual host on apache & now the file httpd-vhosts.conf looks like this :

ServerName localhost

DocumentRoot “/Applications/MAMP/htdocs”

<Directory "/Applications/MAMP/htdocs">
    Options Indexes FollowSymLinks 
    AllowOverride All 
    Order allow,deny
    Allow from All
</Directory>

ErrorLog /Applications/MAMP/logs/error.log

CustomLog /Applications/MAMP/logs/access.log combined

Following these instructions to enable the mod rewrite on i edited the .htaccess file and now it looks like this :

RewriteEngine On

RewriteBase /libs/FatFreeFramework/fatfree-master/

RewriteCond %{REQUEST_FILENAME} !-l

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule .* /libs/FatFreeFramework/fatfree-master/index.php [L,QSA]

I modified the rewrite base to point to the /[dirname]/ and then change RewriteRule to /[dirname]/index.php

In the httpd.conf i edited the Directory to AllowOverride All but still i cannot get the project running on browser.

I noticed that there are 2 .htaccess files, one on the htdocs dir & another on fatfree-master dir!

Which one of them do i have to edit in order to enable the mod rewrite on the fatfree-framework?

Do i point correctly the path of the index.php?

3
don't change the path of the RewriteRule. It should simple stay index.php. The Rewritebase is used to assign the path.ikkez
Thank you for the reply!geokara1322

3 Answers

3
votes

Just use this .htaccess would be fine.

RewriteEngine On
RewriteCond %{REQUEST_URI} \.ini$
RewriteRule \.ini$ - [R=404]
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php [L,QSA]
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
1
votes

Only .htaccess that matters is the one in dir that you access from browser (in your case after typing localhost, it should be the one in htdocs.

Secondly, check with phpinfo() function if you have mod_rewrite enabled. If no, enable it.

Lastly, I think you should set RewriteBase to /.

One thing you can also try (cause I'm not sure) is adding Options +FollowSymLinks right after RewriteEngine On

0
votes

Have you enabled the mod_rewrite module on Apache?

I believe it resides in the httpd.conf file where you will need to uncomment a LoadModule mod_rewrite line.