dou6495 2016-04-29 14:40
浏览 47
已采纳

如何在本地使用XAMPP设置F3?

I am trying to run a Fat Free PHP project locally with XAMPP from C:\xampp\htdocs\abc My problem is none of my css, images, or links work. I added an .htaccess file:

RewriteEngine On
RewriteBase /abc/
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /abc/index.php [L,QSA]

It seems to have helped somewhat in that my index.php loads but none of the css nor images load. Also, when I click any links I get 404s, and the url does not route to my /abc directory.

I have tried countless RewriteRules and RewriteConds with no luck.

Also, everything works fine in production so I would like to not change the structure.

Any help on the would be greatly appreciated, thanks.

  • 写回答

3条回答 默认 最新

  • douzhang7184 2016-05-04 14:48
    关注

    Try with this .htaccess:

    RewriteEngine On
    RewriteBase /abc/
    
    # skip all files and directories from rewrite rules below
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ - [L]
    
    RewriteRule (.+\.(?:gif|png|jpe?g|css))$ /abc/$1 [NC,L]
    RewriteRule .* /abc/index.php [L]
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥50 三种调度算法报错 有实例
  • ¥15 关于#python#的问题,请各位专家解答!
  • ¥200 询问:python实现大地主题正反算的程序设计,有偿
  • ¥15 smptlib使用465端口发送邮件失败
  • ¥200 总是报错,能帮助用python实现程序实现高斯正反算吗?有偿
  • ¥15 对于squad数据集的基于bert模型的微调
  • ¥15 为什么我运行这个网络会出现以下报错?CRNN神经网络
  • ¥20 steam下载游戏占用内存
  • ¥15 CST保存项目时失败
  • ¥20 java在应用程序里获取不到扬声器设备