錯誤這是使用Slim
我的第一次,我想給它一個別名頁面使用WampServer
試試,我的計劃是使一些應用Restful API
,一切當頁面加載的一切,但工作正常Slim
,但是當我到達這需要Slim
要加載的請求,我得到404 not found
錯誤,我認爲這是.htaccess
問題,所以我做了這個代碼的文件:修身:使用WAMP
RewriteEngine On
RewriteBase /webpages/organizer 2.0/api/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [QSA,L]
Slim
文件是在API的文件夾,以便我添加了RewriteBase
以使api的每個請求都變成紅色irected到index.php
,所以,當我嘗試另一個請求,我得到500 Internal Server Error
我不知道是什麼讓這種情況發生,因爲我用這相同的規則與Yii
框架其他應用程序,並能正常工作,甚至當我刪除此.htaccess
文件,然後再試一次,但這次請求的特定文件,我仍然得到404 not found
但Slim
模板錯誤
的index.php
<?php
require('../vendor/autoload.php');
$app = new \Slim\Slim();
$app->get('/test/:word', function($word){
echo $word;
});
$app->run();
文件夾結構:
organizer 2.0 {
vendor: {
autoload.php,
Slim: {
...
}
},
api: {
.htaccess,
index.php
},
bower_components: {
...
},
index.php
}
注:沒有.htaccess
我試圖訪問localhost/webpages/organizer 2.0/api/index.php/test/hello
和苗條得到404錯誤,但.htaccess
試圖localhost/webpages/organizer 2.0/api/test/hello
更改代碼,unistalling並重新安裝了幾個小時之後返回內部錯誤