doupu5941 2014-12-04 15:10
浏览 15
已采纳

无脂框架mod重写不起作用

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条回答 默认 最新

  • doob0526 2014-12-06 19:26
    关注

    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]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私