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

    报告相同问题?

    悬赏问题

    • ¥15 想问一下树莓派接上显示屏后出现如图所示画面,是什么问题导致的
    • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
    • ¥15 cmd cl 0x000007b
    • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
    • ¥500 火焰左右视图、视差(基于双目相机)
    • ¥100 set_link_state
    • ¥15 虚幻5 UE美术毛发渲染
    • ¥15 CVRP 图论 物流运输优化
    • ¥15 Tableau online 嵌入ppt失败
    • ¥100 支付宝网页转账系统不识别账号