Laravel路线,index.php,以前不需要

时间:2017-01-09 18:52:42

标签: laravel routes localhost

我有一个用laravel编写的项目,没有任何(由我知道)的原因,突然没有路由,但主要求url中的index.php。

例如 - http://localhost:8080/argentinaremataNew/public/index.php/portada确实有效,但http://localhost:8080/argentinaremataNew/public/portada没有。

问题只发生在localhost中,只发生在其中一个项目中,localhost上的两个项目都使用相同的.htaccess,默认为laravel

可能出现什么问题?

PS: 这是我的.htaccess

<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}]

更新:我使用不带index.php的路线的错误是:

NotFoundHttpException in RouteCollection.php line 161:
in RouteCollection.php line 161
at RouteCollection->match(object(Request)) in Router.php line 766
at Router->findRoute(object(Request)) in Router.php line 621
at Router->dispatchToRoute(object(Request)) in Router.php line 607
at Router->dispatch(object(Request)) in Kernel.php line 268
at Kernel->Illuminate\Foundation\Http\{closure}(object(Request)) in Pipeline.php line 53
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in CheckForMaintenanceMode.php line 46
at CheckForMaintenanceMode->handle(object(Request), object(Closure)) in Pipeline.php line 137
at Pipeline->Illuminate\Pipeline\{closure}(object(Request)) in Pipeline.php line 33
at Pipeline->Illuminate\Routing\{closure}(object(Request)) in Pipeline.php line 104
at Pipeline->then(object(Closure)) in Kernel.php line 150
at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 117
at Kernel->handle(object(Request)) in index.php line 54

我也在index.php中转储了请求,在ServerBag的参数中我发现了这个差异:

DIFF

错误

"REDIRECT_STATUS" => "200"
"HTTP_CACHE_CONTROL" => "max-age=0"
"REDIRECT_URL" => "/argentinaRemataLaravel/public/remates"
"REQUEST_URI" => "/argentinaRemataLaravel/public/remates"
"PHP_SELF" => "/ArgentinaRemataLaravel/public/index.php"
"REQUEST_TIME_FLOAT" => 1484155078.67
"REQUEST_TIME" => 1484155078

确定

"REQUEST_URI" => "/argentinaRemataLaravel/public/index.php/remates"
"PATH_INFO" => "/remates"
"PATH_TRANSLATED" => "C:\wamp64\www\remates"
"PHP_SELF" => "/argentinaRemataLaravel/public/index.php/remates"
"REQUEST_TIME_FLOAT" => 1484155074.707
"REQUEST_TIME" => 1484155074

=============================================== ================================================== ===========================================

错误

"REDIRECT_STATUS" => "200"
"HTTP_HOST" => "localhost"
"HTTP_CONNECTION" => "keep-alive"
"HTTP_CACHE_CONTROL" => "max-age=0"
"HTTP_UPGRADE_INSECURE_REQUESTS" => "1"
"HTTP_USER_AGENT" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
"HTTP_ACCEPT" => "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
"HTTP_ACCEPT_ENCODING" => "gzip, deflate, sdch, br"
"HTTP_ACCEPT_LANGUAGE" => "es-ES,es;q=0.8,en;q=0.6"
"HTTP_COOKIE" => "Phpstorm-41ab736d=2b43fb9f-e131-4096-8172-e695f536039c; XSRF-TOKEN=eyJpdiI6IjJIUVBjcWRnd2djaFlnTFNHT1hQbUE9PSIsInZhbHVlIjoiazRId1lNdVBGaXYzSEs1MENJbURONHRaeHVmMWJvWFR6ekFMakh3S0V1QVVhNzhXc0lpaFlnSG5oV3BcLzU5TDdWN2h3RjlcL1ZkaEQ0eHJxY1c3UUxpUT09IiwibWFjIjoiOTgyYTcwZGY4N2ExZjQ2YjlkMzViZWVjOWY1YTUxNWM5Y2E5MTkzOWNhMmJkNjQwM2RkOTA4NjA5MmU4NWYxMyJ9; laravel_session=eyJpdiI6Im1vTDlSd1ZwcitWc0dVOERYcDVSQ1E9PSIsInZhbHVlIjoiVVwvcngwallRQ0RvTE1UbXdmb2tmcTd5OVR4eDRcL2l5a3JSaTRWdlJRXC96MTNxeXQ0UGxlajZMTXVZOU9LM0xwZ0NsYjdVMnp3WXNQN1wveTFUT1FzSDF3PT0iLCJtYWMiOiI4MjRkZjI2NTRmYzY4NjU2MDAxYzE1MmQwZDlhMTU3YWE5MjFmODY4Y2FhNjA3MTFjZmQzMzQ2MzcyOWYwYmRmIn0%3D"
"PATH" => "C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\wamp\bin\php\php5.5.12;C:\ProgramData\ComposerSetup\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Bitvise SSH Client;"
"SystemRoot" => "C:\Windows"
"COMSPEC" => "C:\Windows\system32\cmd.exe"
"PATHEXT" => ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
"WINDIR" => "C:\Windows"
"SERVER_SIGNATURE" => "<address>Apache/2.4.23 (Win64) PHP/5.6.25 Server at localhost Port 80</address>\n"
"SERVER_SOFTWARE" => "Apache/2.4.23 (Win64) PHP/5.6.25"
"SERVER_NAME" => "localhost"
"SERVER_ADDR" => "::1"
"SERVER_PORT" => "80"
"REMOTE_ADDR" => "::1"
"DOCUMENT_ROOT" => "C:/wamp64/www"
"REQUEST_SCHEME" => "http"
"CONTEXT_PREFIX" => ""
"CONTEXT_DOCUMENT_ROOT" => "C:/wamp64/www"
"SERVER_ADMIN" => "wampserver@wampserver.invalid"
"SCRIPT_FILENAME" => "C:/wamp64/www/ArgentinaRemataLaravel/public/index.php"
"REMOTE_PORT" => "9812"
"REDIRECT_URL" => "/argentinaRemataLaravel/public/remates"
"GATEWAY_INTERFACE" => "CGI/1.1"
"SERVER_PROTOCOL" => "HTTP/1.1"
"REQUEST_METHOD" => "GET"
"QUERY_STRING" => ""
"REQUEST_URI" => "/argentinaRemataLaravel/public/remates"
"SCRIPT_NAME" => "/ArgentinaRemataLaravel/public/index.php"
"PHP_SELF" => "/ArgentinaRemataLaravel/public/index.php"
"REQUEST_TIME_FLOAT" => 1484155078.67
"REQUEST_TIME" => 1484155078

确定

"HTTP_HOST" => "localhost"
"HTTP_CONNECTION" => "keep-alive"
"HTTP_UPGRADE_INSECURE_REQUESTS" => "1"
"HTTP_USER_AGENT" => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36"
"HTTP_ACCEPT" => "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8"
"HTTP_ACCEPT_ENCODING" => "gzip, deflate, sdch, br"
"HTTP_ACCEPT_LANGUAGE" => "es-ES,es;q=0.8,en;q=0.6"
"HTTP_COOKIE" => "Phpstorm-41ab736d=2b43fb9f-e131-4096-8172-e695f536039c; XSRF-TOKEN=eyJpdiI6IjJIUVBjcWRnd2djaFlnTFNHT1hQbUE9PSIsInZhbHVlIjoiazRId1lNdVBGaXYzSEs1MENJbURONHRaeHVmMWJvWFR6ekFMakh3S0V1QVVhNzhXc0lpaFlnSG5oV3BcLzU5TDdWN2h3RjlcL1ZkaEQ0eHJxY1c3UUxpUT09IiwibWFjIjoiOTgyYTcwZGY4N2ExZjQ2YjlkMzViZWVjOWY1YTUxNWM5Y2E5MTkzOWNhMmJkNjQwM2RkOTA4NjA5MmU4NWYxMyJ9; laravel_session=eyJpdiI6Im1vTDlSd1ZwcitWc0dVOERYcDVSQ1E9PSIsInZhbHVlIjoiVVwvcngwallRQ0RvTE1UbXdmb2tmcTd5OVR4eDRcL2l5a3JSaTRWdlJRXC96MTNxeXQ0UGxlajZMTXVZOU9LM0xwZ0NsYjdVMnp3WXNQN1wveTFUT1FzSDF3PT0iLCJtYWMiOiI4MjRkZjI2NTRmYzY4NjU2MDAxYzE1MmQwZDlhMTU3YWE5MjFmODY4Y2FhNjA3MTFjZmQzMzQ2MzcyOWYwYmRmIn0%3D"
"PATH" => "C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\ProgramData\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Skype\Phone\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\;C:\Program Files (x86)\MySQL\MySQL Fabric 1.5 & MySQL Utilities 1.5\Doctrine extensions for PHP\;C:\Program Files\TortoiseSVN\bin;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\Tools\Binn\;C:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PrivateAssemblies\;C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\;C:\Program Files\Microsoft\Web Platform Installer\;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\wamp\bin\php\php5.5.12;C:\ProgramData\ComposerSetup\bin;C:\HashiCorp\Vagrant\bin;C:\Program Files (x86)\Bitvise SSH Client;"
"SystemRoot" => "C:\Windows"
"COMSPEC" => "C:\Windows\system32\cmd.exe"
"PATHEXT" => ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC"
"WINDIR" => "C:\Windows"
"SERVER_SIGNATURE" => "<address>Apache/2.4.23 (Win64) PHP/5.6.25 Server at localhost Port 80</address>\n"
"SERVER_SOFTWARE" => "Apache/2.4.23 (Win64) PHP/5.6.25"
"SERVER_NAME" => "localhost"
"SERVER_ADDR" => "::1"
"SERVER_PORT" => "80"
"REMOTE_ADDR" => "::1"
"DOCUMENT_ROOT" => "C:/wamp64/www"
"REQUEST_SCHEME" => "http"
"CONTEXT_PREFIX" => ""
"CONTEXT_DOCUMENT_ROOT" => "C:/wamp64/www"
"SERVER_ADMIN" => "wampserver@wampserver.invalid"
"SCRIPT_FILENAME" => "C:/wamp64/www/ArgentinaRemataLaravel/public/index.php"
"REMOTE_PORT" => "9812"
"GATEWAY_INTERFACE" => "CGI/1.1"
"SERVER_PROTOCOL" => "HTTP/1.1"
"REQUEST_METHOD" => "GET"
"QUERY_STRING" => ""
"REQUEST_URI" => "/argentinaRemataLaravel/public/index.php/remates"
"SCRIPT_NAME" => "/argentinaRemataLaravel/public/index.php"
"PATH_INFO" => "/remates"
"PATH_TRANSLATED" => "C:\wamp64\www\remates"
"PHP_SELF" => "/argentinaRemataLaravel/public/index.php/remates"
"REQUEST_TIME_FLOAT" => 1484155074.707
"REQUEST_TIME" => 1484155074

有人可以帮我一把吗?

谢谢:D

0 个答案:

没有答案