1
我使用htaccess的這個樣子,Silex的路線,htaccess的
RewriteEngine On
RewriteBase /link/application/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
簡單的index.php在/應用程序/文件夾這樣
<?php
require_once __DIR__ . '/../framework/autoload.php';
$app = new Silex\Application();
$app['debug'] = true;
$app->get('/', function() {
return 'Hello!';
});
$app->run();
,當我試圖訪問本地主機/鏈接,Silex的給我一個錯誤
NotFoundHttpException: No route found for "GET /link/"
所以要解決這個問題,我需要改變我的$ APP->得到
$app->get('/link/', function() {
是否有任何方法使用RewriteEngine但不能重寫Silex路由(將其保留爲「/」)? 我在做什麼錯?