duanshan7261
2015-10-14 04:12
浏览 38

WAMP,Laravel 5:路由无效 - NotFoundHttpException

I'm using Laravel 5 with WAMP on my local machine, no virtualization. After creating a fresh project using Composer called "LaravelProject", I can't seem to get my routes working at all. What I've already done:

  • Edited httpd.conf to uncomment the line

    LoadModule rewrite_module modules/mod_rewrite.so

  • Edited the /public/.htaccess file to be

    Options +FollowSymLinks
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

  • Refreshed WAMP

  • "localhost/laravelproject/public" works
  • "localhost/laravelproject/public/index.php/signup" works
  • "localhost/laravelproject/public/signup" throws the NotFoundHttpException

The error:

Sorry, the page you are looking for could not be found.
NotFoundHttpException in RouteCollection.php line 161

routes.php:

Route::get('/', function() {
    return view('welcome');
});


Route::get('/signup', function() {
    return view('auth.signup');
});

All other questions I've found say that it's an .htaccess and mod_rewrite problem, but I have already tried those solutions. This is a completely fresh installation, the only extra file is the signup.blade.php view. Please help!

图片转代码服务由CSDN问答提供 功能建议

我在本地计算机上使用Laravel 5和WAMP,没有虚拟化。 在使用名为“LaravelProject”的Composer创建一个新项目之后,我似乎无法让我的路线工作。 我已经完成了什么:

  • 编辑httpd.conf以取消注释

    LoadModule rewrite_module modules / mod_rewrite.so

  • 编辑/public/.htaccess文件

    选项+ FollowSymLinks
    RewriteEngine On
    RewriteCond%{REQUEST_FILENAME}!-d
    RewriteCond%{REQUEST_FILENAME}!-f
    RewriteRule ^ index.php [L]

  • 刷新WAMP

  • “localhost / laravelproject / public”工作< /li>
  • "localhost/laravelproject/public/index.php/signup“正常工作
  • ”localhost / laravelproject / public / signup“ 抛出NotFoundHttpException

    错误:

     抱歉,您要查找的页面可能 找不到。
    NotFoundHttpException在RouteCollection.php第161行
       
     
     

    routes.php:

      Route ::  get('/',function(){
     return view('welcome'); 
    }); 
     
     
    Route :: get('/ signup',fun  ction(){
     return view('auth.signup'); 
    }); 
       
     
     

    我发现的所有其他问题都说它是一个。 htaccess和mod_rewrite问题,但我已经尝试过这些解决方案。 这是一个全新的安装,唯一的额外文件是signup.blade.php视图。 请帮忙!

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

相关推荐 更多相似问题