我Altorouter
在一个基本的 PHP 应用程序(无框架)中使用,但不知何故它不起作用。以下是详细信息:
索引.php
<?php
error_reporting(E_ALL);
ini_set('display_errors',1);
require_once __DIR__ . '/vendor/autoload.php';
$router = new AltoRouter();
$router->map( 'GET', '/', function() {
include __DIR__ . 'home.php';
});
print "Done";
它在 php 日志中打印完成并且没有错误。
htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]