2012-12-05 57 views
0

我試圖在MAC上測試我的Mac下XAMPP或本機Apache服務器上的Slim,但是在任何作品下。按照代碼:Slim aways顯示404錯誤頁面

<? 

require 'Slim/Slim.php'; 

\Slim\Slim::registerAutoloader(); 

$app = new \Slim\Slim(); 

$app->get('/', function() { 
    echo '<h1>Sample test!!!</h1>'; 
}); 

// POST route 
$app->post('/post', function() { 
    echo 'This is a POST route'; 
}); 

// PUT route 
$app->put('/put', function() { 
    echo 'This is a PUT route'; 
}); 

// DELETE route 
$app->delete('/delete', function() { 
    echo 'This is a DELETE route'; 
}); 

$app->run(); 

?> 

看看GET函數回調只是打印H1文本。

我的.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] 

我沒有,我在斯利姆的網站得到了原始文件的修改,然後繼續顯示在瀏覽器404錯誤!

有人能幫我嗎?!

回答

0

我是一個5.2.x版本而不是5.3.x!