Laravel 拉韦尔误差:“;很抱歉,找不到您要查找的页面;

Laravel 拉韦尔误差:“;很抱歉,找不到您要查找的页面;,laravel,laravel-5,xampp,laravel-5.5,easyphp,Laravel,Laravel 5,Xampp,Laravel 5.5,Easyphp,我需要从一位同事那里更新一个网站,以便只添加LDAP连接 我在PHP7.1.3和MySQL 5.7.17中使用EasyHP devserver 17.0 我已经阅读了很多文档等,以开始和恢复在当地的网站,因为它是实际工作 一切正常,所以我开始添加登录表单等。。。但是当我尝试测试网站的链接时,它返回错误“对不起,找不到您正在查找的页面”。所以我开始在论坛上搜索,我找到了一些关于路线等的结果,但我测试的所有东西都不起作用 所以,我决定使用网站的备份,就像我在本地恢复它时一样(我精确链接到其他页面,一

我需要从一位同事那里更新一个网站,以便只添加LDAP连接

我在PHP7.1.3和MySQL 5.7.17中使用EasyHP devserver 17.0

我已经阅读了很多文档等,以开始和恢复在当地的网站,因为它是实际工作

一切正常,所以我开始添加登录表单等。。。但是当我尝试测试网站的链接时,它返回错误“对不起,找不到您正在查找的页面”。所以我开始在论坛上搜索,我找到了一些关于路线等的结果,但我测试的所有东西都不起作用

所以,我决定使用网站的备份,就像我在本地恢复它时一样(我精确链接到其他页面,一切正常)。我检查了链接,然后再次说,“对不起,找不到您要查找的页面”。我决定尝试另一个开发工具并下载XAMP,完全相同的错误。我试着用Wamp,Laragon总是犯同样的错误

在apache配置中,启用了mod_rewrite

我的laravel框架版本是:5.5.39

所以我的文件夹看起来像:

routes>web.php的内容:

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

// Holidays
Route::get('/holidays/create', 'HolidayController@create')->name('holidays.create');
Route::post('/holidays', 'HolidayController@store')->name('holidays.store');
Route::get('/holidays/{holiday}/delete', 'HolidayController@destroy')->name('holidays.destroy');
Route::get('/holidays/{holiday}/edit', 'HolidayController@edit')->name('holidays.edit');
Route::post('/holidays/{holiday}', 'HolidayController@update')->name('holidays.update');

// Leave types
Route::get('/types/create', 'TypeController@create')->name('types.create');
Route::post('/types', 'TypeController@store')->name('types.store');
Route::get('/types/{type}/delete', 'TypeController@destroy')->name('types.destroy');
Route::get('/types/{type}/edit', 'TypeController@edit')->name('types.edit');
Route::post('/types/{type}', 'TypeController@update')->name('types.update');

// Users
Route::resource('users', 'UserController');
Route::get('/births', 'UserController@getAllBirths')->name('births');

// Leaves
Route::get('/calendar', 'LeaveController@index')->name('calendar');
Route::post('/leaves', 'LeaveController@store')->name('leaves.store');
Route::post('/leaves/{leave}', 'LeaveController@update')->name('leaves.update');
Route::get('/leaves/{leave}/delete', 'LeaveController@delete')->name('leaves.delete');
Route::get('/leaves', 'LeaveController@getAll')->name('leaves');

Route::get('/config', 'ConfigController@index')->name('config');

// Stats
Route::get('/statistics', 'StatsController@index')->name('stats.index');

Auth::routes();
我在Httpd.conf中的虚拟主机是:

<VirtualHost 127.0.0.1>
    DocumentRoot "C:/Users/sadm-m263733/Desktop/EasyPHP-Devserver-17/eds-www"
    ServerName 127.0.0.1
    <Directory "C:/Users/sadm-m263733/Desktop/EasyPHP-Devserver-17/eds-www">
        Options FollowSymLinks Indexes ExecCGI
        AllowOverride All
        Order deny,allow
        Allow from 127.0.0.1
        Deny from all
        Require all granted
    </Directory>
</VirtualHost>
然后在中间件RedirectIfAuthenticated.php中:

use Illuminate\Support\Facades\Auth;

class RedirectIfAuthenticated
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @param  string|null  $guard
     * @return mixed
     */
    public function handle($request, Closure $next, $guard = null)
    {
        if (Auth::guard($guard)->check()) {
            return redirect('/home');
        }

        return $next($request);
    }
}
您认为我需要从HomeController中删除此部分吗:

public function __construct()
{
    $this->middleware('auth');
}
这部分来自中间件:

if (Auth::guard($guard)->check()) {
            return redirect('/home');
        }

我已经在routes/web.php中删除了auth路由,因为您没有对应用程序使用身份验证,请从控制器中删除
auth
中间件,这样做会很好

$this->middleware('auth'); //Remove this line

更改VirutalHost DocumentRoot,使其成为
public
目录

DocumentRoot "C:/Users/sadm-m263733/Desktop/EasyPHP-Devserver-17/eds-www/siteBTPlan/public"

Laravel的根不是Laravel文件夹的根。您需要将文档根目录设置为Laravel
public
文件夹

DocumentRoot "<your-laravel-path>/public"
DocumentRoot”/public

尝试
php artisan route:list
查看您的身份验证路由设置是否正确。另外,请尝试快速缓存清除:
php artian cache:clear
@SystemGlitch谢谢您的回答,我已经尝试了您的命令
route:list
,它会返回我的所有路由,没有任何错误。这是否意味着我所有路线的语法都是正确的?路径列表中的
cach:clear
命令也没有解决我的问题(我也从浏览器中删除了缓存),请检查登录路径是否正确设置并指向正确的控制器方法。@SystemGlitch我的网站上没有身份验证,因此登录路径从未使用过。我的问题可能是因为没有使用登录路由吗?那么您不应该创建身份验证路由。(删除
Auth::routes()
)并检查您的控制器是否未使用
Auth
中间件,否则它将尝试重定向到登录页面。我已删除该行,然后
php artisan cache:clear
,清除我的浏览器缓存,我仍然会遇到相同的错误。这一行是否出现在其他地方?在Routes/api.php:
Route::middleware('auth:api')->get('/user',function(Request$Request){return$Request->user();})
您也可以删除这一行,但这不会解决问题谢谢您的回答,但是@systemGlitch在10天前已经回答了!
DocumentRoot "<your-laravel-path>/public"