2012-12-01 2 views
0

Slim으로 놀고 있는데, MAMP를 실행하는 로컬 컴퓨터에서 잘 작동합니다. 루트 URL은 "home"을 나타내고// features는 "features"를 표시합니다. 그러나 내 Linode 시스템에서는 루트 ("home") 만 작동합니다. 내가 갈 때/기능 나는 404Slave 로컬 컴퓨터에서 작동하지만 원격 서버에서 작동하지 않습니다.

<?php 

//Slim Framework 
require 'Slim/Slim.php'; 

\Slim\Slim::registerAutoloader(); 

//Instantiate, register URIs 
$app = new \Slim\Slim(array(
    'debug' => true 
)); 

$app->get('/', 'getHome'); 
$app->get('/features', 'getFeatures'); 

$app->run(); 

function getHome() { 
    echo "home"; 
}; 


function getFeatures() { 
    echo "features"; 
}; 

?> 

답변

1

내가 모드 재 작성 내 htaccess로 파일에 설정하지 않았다 밝혀 얻을. 다음 .htaccess를 업로드하면 내 문제가 해결되었습니다.

RewriteEngine On 

# Some hosts may require you to use the `RewriteBase` directive. 
# If you need to use the `RewriteBase` directive, it should be the 
# absolute physical path to the directory that contains this htaccess file. 
# 
# RewriteBase/

RewriteCond %{REQUEST_FILENAME} !-f 
RewriteRule^index.php [QSA,L] 
관련 문제