本文介绍了标题重定向在某些浏览器中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
header('Location:\dealer\skuska \layout.php');
在Chrome中,此功能可正常使用,但在Firefox中会重定向到:
http://212.5.221.26:85/dealer/skuska/actions/\dealer\skuska\index.php
code>
为什么会发生这种情况,我该如何解决它?
解决方案
您需要使用像这样的完整路径
header('Location:http:/ /example.com/dealer/skuska/layout.php');
也将 \
更改为 /
试试这个,这可以在所有浏览器中使用。
I'm using this command to redirect to another page:
header('Location: \dealer\skuska\layout.php');
In Chrome this works correctly, but in Firefox it is redirecting to:
http://212.5.221.26:85/dealer/skuska/actions/\dealer\skuska\index.php
Why is that happening, and how could I fix it?
解决方案
you need to use full path like this
header('Location: http://example.com/dealer/skuska/layout.php');
also change \
to /
try this, this will work in all browsers.
这篇关于标题重定向在某些浏览器中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!