【发布时间】:2020-08-26 22:00:07
【问题描述】:
我需要将非常简单的 laravel 7 应用程序部署到 Elasticbeanstalk,我做了一切just like this tutorial
一切都很好,直到我点击除/ 路线之外的任何其他路线。
http://laravelbooksystem-env.eba-vmyh6fvn.us-east-2.elasticbeanstalk.com/(工作中)
http://laravelbooksystem-env.eba-vmyh6fvn.us-east-2.elasticbeanstalk.com/experts(不工作)
web.php
Route::get('/', function () {
return view('welcome');
});
Route::get('/experts', 'ExpertsController@index');
Route::get('/experts/{id}/show', 'ExpertsController@show');
Route::get('/experts/{id}/book', 'AppointmentsController@display');
Route::post('/appointment/{id}', 'AppointmentsController@store');
.htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
.ebextensions
container_commands:
01_clear_config:
command: "php artisan config:clear"
02_clear_cache:
command: "php artisan cache:clear"
03_build_db:
command: "php artisan migrate --force"
04_seed:
command: "php artisan db:seed --force"
关于如何解决这个问题的任何线索?
【问题讨论】:
-
分享您的路线和刀片文件,以便我们为您提供帮助
-
@Makdous,一定要给我一个 mnt。
标签: laravel amazon-elastic-beanstalk