2012-12-01 76 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] 
相关问题