302重定向到非HTTP协议 [英] 302 redirect to non-HTTP protocol
本文介绍了302重定向到非HTTP协议的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要使用PHP执行302重定向.我正在尝试使用标头位置.
I need to perform a 302 redirect with PHP. I'm trying with header location.
它与HTTP一起很好地工作.但是,重定向不适用于自定义协议.例如:
It works well with HTTP. But, the redirect does not work with a custom protocol. For example:
header ('Location: magplus://myaccountview/login/');
我该如何解决?
推荐答案
对于某些浏览器,您将无法重定向到HTTP或HTTPS以外的协议.您对此无能为力.
For some browsers, you will not be able to redirect to a protocol other than HTTP or HTTPS. There is nothing you can do about that specifically.
如果可能的话,您可以尝试使用JavaScript更改浏览器客户端中的位置.但是,这也不总是可行.
You can try to change the location in the browser client-side with JavaScript, if that is a possibility for your application. That also won't always work however.
这篇关于302重定向到非HTTP协议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文