如何重定向我的应用Url来玩商店应用?

时间:2015-10-21 12:22:51

标签: android html redirect google-play

我有一个godaddy域名,我已将其重定向到我的应用程序URL,但当我在手机上输入godaddy域名时,它会打开一个不会重定向到Google Play商店应用程序的网页。

转发至https 301 Redirect Permanent(更新我的名称服务器和DNS设置以支持此更改。(推荐)

当我进入godaddy域时,我应该怎么做才能在Play商店中打开我的应用程序?

2 个答案:

答案 0 :(得分:0)

在您网站的索引页面上,只需输入以下代码:

<html>
<head>
<meta http-equiv="refresh" content="0; url=<URL_TO_PLAY_STORE>" />
</head>
</html>

现在,每当有人打开您的网站时,他/她都会被重定向到URL_TO_PLAY_STORE

参考:Redirect from an HTML page

答案 1 :(得分:0)

在您的网页上使用此脚本检测移动设备并转移到播放商店,itune商店或Windows商店

<script type="text/javascript" language="javascript">

    var isMobile = {
        Android: function () {
            return /Android/i.test(navigator.userAgent);
        },
        BlackBerry: function () {
            return /BlackBerry/i.test(navigator.userAgent);
        },
        iOS: function () {
            return /iPhone|iPad|iPod/i.test(navigator.userAgent);
        },
        Windows: function () {
            return /IEMobile/i.test(navigator.userAgent);
        },
        any: function () {
            return (isMobile.Android() || isMobile.BlackBerry() || isMobile.iOS() || isMobile.Windows());
        }
    };

    if (isMobile.Windows()) {
        window.location = "Windows App Url";
    }
    else if (isMobile.iOS()) {
        window.location = "itune store url";
    }
    else if (isMobile.Android()) {
        window.location = "play store url";
    }

</script>
相关问题