我正在使用Laravel Homestead将虚拟机应用到我的开发环境中.我最近在我家创建了一个新的 map (/Website/Site/
目录).yaml每当我转到site.app
页时,我都会被重定向到另一个项目(/Laravel
)中设置的/tasks页.(这会导致一个错误,因为页面不存在).这是我的家园.yaml文件:
folders:
- map: /Users/me/Homestead/Code/Laravel
to: /home/vagrant/Code/Laravel
- map: /Users/me/Homestead/Code/Larabook
to: /home/vagrant/Code/Larabook
- map: /Users/me/Homestead/Code/Website/Site
to: /home/vagrant/Code/Website
sites:
- map: homestead.app
to: /home/vagrant/Code/Laravel/public
- map: larabook.app
to: /home/vagrant/Code/Larabook/public
- map: site.app
to: /home/vagrant/Code/Website/public
variables:
- key: APP_ENV
value: local
Laravel包含重定向索引页的路由,而WebSite目录是新项目,它只是全新安装了Laravel,没有其他内容.以下是一些服务器/请求数据错误输出:
SCRIPT_FILENAME /home/vagrant/Code/Laravel/public/index.php
SCRIPT_NAME /index.php
REQUEST_URI /tasks
DOCUMENT_URI /index.php
DOCUMENT_ROOT /home/vagrant/Code/Laravel/public
Here is the route.php for the project in Laravel/ (i.e. the old project)
Route::get('/', function(){
return Redirect::to('tasks');
});
Why is a fresh install of Laravel being redirected by a project in a different directory?
SOLUTION
vagrant reload --provision
or, more drastically
- 从
~/Homestead
开始运行vagrant destroy
然后运行vagrant up