duanchoupo1104 2017-02-14 08:54
浏览 28

.htaccess永远不会抛出错误

I am new to PHP and especially Apache but I am familiar with NodeJS. I am trying to use the Slim Micro Framework with PHP/Apache and I am having problems due to my .htaccess because it never seems to give any errors, even with asdfasfsf at the top of my .htaccess file.

I need this to run:

.htaccess

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
</IfModule>

So that my server will return trigger my http /home route made with Slim, instead of searching for a /home directory, but it has been really hard to debug when Apache doesn't throw any errors.

From my research, I believe I have to do something in the etc folder, but I just installed Apache2_4 without any XAMP or WAMP, so I don't have this folder yet. I would appreciate any tips on using middleware to serve static .css and .js files as well if that's a thing.

routes.php

<?php

$server->get('/home', function ($request, $response) {
    return 'Home';
});
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥30 求一段fortran代码用IVF编译运行的结果
    • ¥15 深度学习根据CNN网络模型,搭建BP模型并训练MNIST数据集
    • ¥15 lammps拉伸应力应变曲线分析
    • ¥15 C++ 头文件/宏冲突问题解决
    • ¥15 用comsol模拟大气湍流通过底部加热(温度不同)的腔体
    • ¥50 安卓adb backup备份子用户应用数据失败
    • ¥20 有人能用聚类分析帮我分析一下文本内容嘛
    • ¥15 请问Lammps做复合材料拉伸模拟,应力应变曲线问题
    • ¥30 python代码,帮调试,帮帮忙吧
    • ¥15 #MATLAB仿真#车辆换道路径规划