简体   繁体   English

laravel redirect :: back()重定向到favicon

[英]laravel redirect::back() redirects to favicon

I have an app using laravel 4.1. 我有一个使用laravel 4.1的应用程序。 In an edit function - which has been working fine up until now has started to attampts to redirect back to favicon instead of the submitting page and throws an httpexception error. 在一个编辑功能 - 一直工作正常,直到现在已经开始尝试重定向回到favicon而不是提交页面并抛出一个httpexception错误。

favicon is being stored in the referrer url session variable for some reason. 由于某种原因,favicon存储在referrer url会话变量中。

On submitting a form to the controller method if there are validation errors it should redirect to the form. 在向控制器方法提交表单时,如果存在验证错误,则应将表单重定向到表单。 The forms URL is http://downscms.loc/articles/300/edit 表单URL为http://downscms.loc/articles/300/edit

it submits to the edit method in controller and should redirect using this code: 它提交到控制器中的编辑方法,并应使用此代码重定向:

return Redirect::back()
        ->withInput()
        ->withErrors($validation)
        ->with('message', 'There were validation errors.');

I'm positive this has been working in the past - I did a composer update over the weekend. 我很肯定这是过去的工作 - 我在周末做了作曲家更新。

This happens in Chrome and Firefox 这种情况发生在Chrome和Firefox中

This is on my testing server which is apache. 这是在我的测试服务器上,这是apache。

On my testing server the favicons do not appear - but I've not had any problems in the past. 在我的测试服务器上没有出现favicons - 但我过去没有遇到任何问题。

Removing the favicon.ico file from the public directory stops the error - but not a correct fix 从公共目录中删除favicon.ico文件可以阻止错误 - 但不是正确的修复

Is this a Laravel issue or an apache issue and how do I resolve? 这是一个Laravel问题还是一个apache问题,我该如何解决?

my .htaccess file on my local server is the unmodified laravel file 我的本地服务器上的.htaccess文件是未修改的laravel文件

ANy help appreciated to get to the bottom of this 任何帮助升值到底

Sounds like a weird problem and this may not be your solution, bet let's give it a go; 听起来像一个奇怪的问题,这可能不是你的解决方案,打赌让我们试一试;

When you request a page, your browser automatically tries to fetch the favicon of the domain. 当您请求页面时,您的浏览器会自动尝试获取域的favicon。 If it doesn't exist (or you misconfigured your .htaccess), then your .htaccess sends the request of to Laravel which will show a 404. 如果它不存在(或者你配置错误的.htaccess),那么你的.htaccess会向Laravel发送请求,显示404。

Maybe, Laravel sets the last URL to be the one to the icon during the invisible favicon.ico request. 也许,Laravel在隐形favicon.ico请求期间将最后一个URL设置为图标。 When you then go 'back', it is the last URL your browser requested. 然后当您“返回”时,它是您的浏览器请求的最后一个URL。

Once again, I could be totally off, but try adding a favicon.ico to the root of your domain and see if that works. 再一次,我可能完全关闭,但尝试将favicon.ico添加到您的域的根目录,看看是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM