例子:Laravel路由不工作,Apache的配置只允許公共/ index.php文件/路由
Route::get('/get', function() {
return 'get';
});
要查看上述路線,我必須導航到公共/ index.php文件/得到。
我已經瀏覽了很多SO帖子並圍繞嘗試不同的東西進行了搜索,並沒有改變(是的,我每次都重啓apache)。
這是我在公共目錄的.htaccess:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
</IfModule>
# For all files not found in the file system, reroute the request to the
# "index.php" front controller, keeping the query string intact
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
什麼可能會導致這還是?我正在運行Ubuntu。
我只是將'root/public/.htaccess移動到root/.htaccess'並且它工作 –