Slim에 대한 다음 Tutorial (9:48)을 수행하고 Slim 기능을 테스트 한 후에도 여전히 "페이지를 찾을 수 없음"이 표시됩니다.
을 programm
이 eg.If는 " http://localhost/authentication/public/test/Hello"검색 특정 시점 이후 검색 창에 입력 한 단어를 에코하도록되어 페이지가 '안녕하세요'페이지해야 에코 '안녕하세요' 에코해야한다..htaccess 파일을 사용하여 모든 링크를 index.php로 다시 라우팅하면됩니다. index.php 파일은 start.php라는 PHP 파일을 실행합니다.
이것이 작동하지 않는 이유에 대한 의견이 있으십니까?
슬림형 V3.0의
의 .htaccess
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [QSA,L]
의 index.php
<?php
require '../app/start.php';
$app->run();
?>
start.php
<?php
use Slim\App;
session_cache_limiter(false);
session_start();
ini_set('display_errors', 'On');
define('INC_ROOT', dirname(__DIR__));
require INC_ROOT . '/vendor/autoload.php';
$app = new App();
$app->get('/test/:name', function($name) {
echo "Hello! {$name}";
});
?>
Apache 웹 서버를 사용합니까? .htaccess와 index.php는 디렉토리 구조에 어디에 있습니까? 어떤 URL에 index.php에 직접 액세스합니까? http : //localhost/authentication/public/index.php입니까? – jirka