doushi2047 2018-08-03 16:48
浏览 51

Laravel 5.4:为什么我的页面没有加载?

I have a laravel project under www.mysite.com and a second project under alias www.mysite.com/portal.

For my second project, my route isn't loading anything. When I go to www.mysite.com/portal i'm expecting to redirect to www.mysite.com/portal/test which is happening. I see the url change to www.mysite.com/portal/test but nothing is loading. This is what I see. Why is this happening? I can't figure out why i'm not seeing Hello World. Locally everything is working properly.

I did copy my /vendor from another project to this one. Don't know if that has anything to do with this issue.

enter image description here



I've tried all these commands

php artisan cache:clear
php artisan view:clear
php artisan route:clear
php artisan clear-compiled
php artisan config:cache

These are my routes.

Route::group(['middleware' => ['web']], function () {

   Route::get('/test',    ['as'=>'get_test',      'uses'=>'AccountController@test']);
   Route::get('/', function () { return \Redirect::route("get_test"); });

});

Controller

class AccountController extends Controller{

   public function test(Request $request){
       return "hello world";
    }
}

This is what I have in my .env file

APP_NAME=Laravel
APP_ENV=local
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost
  • 写回答

2条回答 默认 最新

  • dqunzip3183 2018-08-03 17:13
    关注

    I think one of your first project's route is satisfying this term www.mysite.com/{param1}/{param2}.

    Two important points

    • when you are trying with www.mysite.com/portal/test here "portal" satisfying param1 and "test" satisfying param2 where you are running a query and after not getting any result you are redirecting to 404.
    • your parent project's .htaccess file is not correctly configured for child project.

    Please check your parent project's route files and .htaccess file

    评论

报告相同问题?

悬赏问题

  • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
  • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
  • ¥15 Centos / PETSc / PETGEM
  • ¥15 centos7.9 IPv6端口telnet和端口监控问题
  • ¥120 计算机网络的新校区组网设计
  • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
  • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
  • ¥20 海浪数据 南海地区海况数据,波浪数据
  • ¥20 软件测试决策法疑问求解答
  • ¥15 win11 23H2删除推荐的项目,支持注册表等