如何为 URL 架构链接设置重新路由?

How to set up rerouting for URL schema links?

我们同时在网络和 iPhone 上。我们想向客户发送电子邮件(交易性的,例如 "your order has shipped"),让他们在应用程序或网站上点击以获取更多信息。

在高层次或产品层次上,下面是如何运作的?我试图了解这是否可行,或者正确的流程是什么。

电子邮件 link 类似于

<a href="http://oursite.com/routing-logic?path/to/destination">link</a>

路由逻辑做类似

的事情
if ourschema:// can open, then open the app (they have the app & are on the device)

else, go to https://oursite.com/path/to/destination

这就是 URL 模式路由的基本工作原理吗?我听说过有关网页是否可以测试设备是否支持给定 URL 架构的相互矛盾的信息。

我认为是 your case

在邮件中添加 link 到简单页面,检查用户代理并有脚本:

<script language="javascript">
var timeout;
function open_webapp() {
    window.location='https://oursite.com/path/to/destination';
}

function try_to_open_app() {
    timeout = setTimeout('open_webapp()', 300);
}
</script>
<a onClick="javascript:try_to_open_app();" href="yourappurl:">App    name</a>

哪里简单url-scheme tutorial.