Laravel 5.5无法找到页面 [英] Laravel 5.5 cant find the page
问题描述
最近,我的应用面临着一个奇怪的问题,该问题至少要到昨天才存在!
recently i'm facing strange issue with my app which wasn't exist at least until yesterday!
如果我尝试打开某些网址,例如myapp.dev/blog
或myapp.dev/categories
等,则会收到错误消息
If I try to open certain urls such as myapp.dev/blog
or myapp.dev/categories
etc. I get error of
对不起,找不到您要查找的页面.
Sorry, the page you are looking for could not be found.
但是如果我将URL更改为myapp.dev/t/blog
之类的东西,它将加载页面!
but if I change my url to something like myapp.dev/t/blog
it will load the page!
有什么主意吗?
Route::get('/categories', 'frontend\FrontendController@totalcategories')->name('allcategories')->where('slug', '[\w\d\-\_]+');
推荐答案
尝试在web.php中将文件结尾或文件开头移动.以我为例,如果您的网址相互冲突,这是一种行为.
try to move your at end of file or start of file in web.php. In my case sometime it's behave if while your url getting conflict with each other.
就我而言,我就像这条路线
in my case my was like routes this
Route::get('{status}/category','TempController@index');
Route::get('category/t','TempController@store');
我只是将我的第一行移到了文件末尾.并且工作正常.
Simply I just moved myfirst line at end of file. and worked fine.
之所以发生这种情况,是因为Laravel将网址的第一个细分视为参数.
This happend because Laravel treat first Segment of URL as argument.
这篇关于Laravel 5.5无法找到页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!