我按照說明here創建了一個測試hello world Slim應用程序。當在網址中省略index.php時,在Slim Framework中始終得到404錯誤
當我撥打這個電話,我得到一個404錯誤:
http://my_server/my_app/hello/John
在另一方面,當我把這個稱之爲它的工作原理隆重,因爲我得到一個「Hello約翰」消息:
http://my_server/my_app/index.php/hello/John
但是,當然,我不想index.php在我的網址...什麼可能是錯的?
======= =======編輯
我忘了創建這樣的.htaccess文件(以下超薄框架文件,並在同一個目錄中的index.php):
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule^index.php [QSA,L]
現在我得到這個錯誤:
/physical_path_to_my_files/index.php was not found on this server
你有一個'mod_rewrite'或一些其他的服務器技術相關的設置去,或者這只是.. 。你建議如何? –
例如:http://expressionengine.com/wiki/Remove_index.php_From_URLs/ –
謝謝@JaredFarrish。我編輯了我的文章:忘了添加.htaccess文件,現在我得到一個不同的錯誤,:-( –