2012-12-01 42 views
0

我正在玩Slim,它運行在我的本地機器運行MAMP偉大。根URL顯示「home」和/ features顯示「features」。然而,在我的Linode機器上,只有根作品(「家」)。當我去/功能,我得到一個404.瘦本地開發機器,但不是遠程服務器

<?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文件打開mod重寫。上傳下面的.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] 
相關問題