我有一个Android应用程序,它使用内部协议来声明一个意图。 您可以通过打开包含以下链接的网页来启动它:
myapplication://foo-bar
我想在我的网站上的一个url,将301redirect到自定义,内部,制定的协议。 这个想法是,我们的Android应用程序将在用户点击该链接时启动(应用程序已经安装)。
我可以简单地在HTML页面中添加一个anchro链接,但是我不能修改这个HTML。 我必须使用Apache。 我试过这个mod_rewrite规则:
RewriteRule "^/app$" myapplication://foo-bar [R=permanent,L]
但是它总是在前面加上主机名,所以我在Location头得到这个:
Location: https://example.com/myapplication://foo-bar
我如何指示mod_rewrite使用myapplication://foo-bar
的URL( myapplication://foo-bar
)?