0

.htaccess ファイルを作成しましたが、動作しますが、alto ルーターのルーティングは動作しません

<?php

require 'altorouter.php';

$router = new AltoRouter();
$router->setBasePath('/rimaxxApi/');
$router->map('GET', '/', function(){

  echo 'It is working';
});

$match = $router->match();

// Here comes the new part, taken straight from the docs:

// call closure or throw 404 status
if( $match && is_callable( $match['target'] ) ) {
    call_user_func_array( $match['target'], $match['params'] );
} else {
    // no route was matched
    header( $_SERVER["SERVER_PROTOCOL"] . ' 404 Not Found');
}

?>

パスはサブフォルダーにあります

このコードでは、「404」エラーが発生し続けますが、ルートが定義されています。

4

1 に答える 1

1

試す$router->setBasePath('/rimaxxApi');

于 2016-09-20T14:14:13.703 に答える