Php Laravel 5.3找不到登录页面
我刚刚开始学习拉威尔,我一直在寻找这个答案。我是按照一个教程一步一步来开始的,我让它运行欢迎屏幕,但如果我点击登录或注册它说,该文件不存在。但是如果我走这条路Php Laravel 5.3找不到登录页面,php,laravel,routes,laravel-5.3,controllers,Php,Laravel,Routes,Laravel 5.3,Controllers,我刚刚开始学习拉威尔,我一直在寻找这个答案。我是按照一个教程一步一步来开始的,我让它运行欢迎屏幕,但如果我点击登录或注册它说,该文件不存在。但是如果我走这条路 Route::get('/', function() { return view('auth/login'); }); 它找到并显示该页面 这是登录页面的链接 <div class="panel panel-success"> <div class="panel-heading">
Route::get('/', function() {
return view('auth/login');
});
它找到并显示该页面
这是登录页面的链接
<div class="panel panel-success">
<div class="panel-heading">List of Game of Thrones Characters</div>
@if(Auth::check())
<p>Success</p>
@endif
</div>
<?php
echo getcwd() . "\n";
?>
@if(Auth::guest())
<a href="/login" class="btn btn-info"> You need to login to see the list You need to setup web server rewrites in your webserver.
The simplest way to handle that is to use a .htaccess
file in your public/
directory. This is the default .htaccess
file for Laravel 5.3:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule>
权力游戏人物列表
@if(Auth::check())
成功
@恩迪夫
@if(Auth::guest())
您需要登录以查看列表您需要在web服务器中设置web服务器重写
最简单的处理方法是在public/
目录中使用.htaccess
文件。这是Laravel 5.3的默认.htaccess
文件:
您需要在web服务器中设置web服务器重写
最简单的处理方法是在public/
目录中使用.htaccess
文件。这是Laravel 5.3的默认.htaccess
文件:
如果将锚定标记更改为index.php/login
,它是否有效?如果是这样,那么您需要设置一个URL重写,将所有请求重写到index.php
。您是否忘记添加右括号和分号,如:)代码>是的,这很有效!我该怎么做?你用的是什么网络服务器?Nginx还是Apache?我使用Apache…如果您将锚点标记更改为index.php/login
,它能工作吗?如果是这样,那么您需要设置一个URL重写,将所有请求重写到index.php
。您是否忘记添加右括号和分号,如:)代码>是的,这很有效!我该怎么做?你用的是什么网络服务器?Nginx还是Apache?我使用Apache…还必须启用Apache重写。感谢您还必须启用apache重写。非常感谢。