我想在Mac操作系統上用Slim運行我的第一個應用程序時遇到問題。我已經配置.htaccess文件是這樣的:我怎麼能在mac中爲slim框架配置.htacces
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
而且我在httpd.conf配置加載模塊重寫,我的index.php放置在同一個目錄中的.htaccess文件。
這是我的PHP代碼(我使用PHP 5.3)
<?php
require 'Slim/Slim.php';
$app = new Slim();
$app->get('hello/:name',function($name) {
echo 'Hello' .$name;
});
$app->run();
?>
當我在使用http://localhost/slim/hello/test
瀏覽器中運行它,我得到錯誤404
我在做什麼錯?