You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by "linux.il" <li...@gmail.com> on 2012/01/09 14:08:22 UTC

[users@httpd] Is it possible to redirect user to "market://..." URI?

On my website I should redirect Android users to my application on Android
Market. What is the optimal way to do this? My first idea was

       RewriteCond %{HTTP_USER_AGENT}  Android [NC]
       RewriteRule ^/$         market://details?id=......

But it doesn't work. Is it doable in Apache?

TIA, Vitaly

Re: [users@httpd] Is it possible to redirect user to "market://..." URI?

Posted by "linux.il" <li...@gmail.com>.
On Wed, Jan 11, 2012 at 2:01 AM, Jeroen Geilman <je...@adaptr.nl> wrote:
> On 01/10/2012 09:17 AM, linux.il wrote:
>>>
>>> On Mon, Jan 9, 2012 at 9:31 PM, Jeroen Geilman<je...@adaptr.nl>  wrote:
>>>
>>>> On 2012-01-09 14:08, linux.il wrote:
>>>>
>>>> On my website I should redirect Android users to my application on
>>>> Android Market. What is the optimal way to do this? My first dea>>was
>>>>
>>>>       RewriteCond %{HTTP_USER_AGENT}  Android [NC]
>>>>       RewriteRule ^/$         market://details?id=......
>>>
>>> There is no market://details application/system/scheme on your apache
>>> server - this is a client-side phenomenon.
>>> Issue a 301 Redirect to the above URL - you can put anything in a
>>> redirect URL.
>>> Convert the above into an explicit redirect by appending [R=301] to the
>>> RewriteRule.
>>
>> Thank you for suggestion. I replaced 302 to 301 return code, but it
>> didn't help - browser tries  to open some weird  URL like this:
>> http://mysite.com/market://details?.....
>>
>
> Perhaps mod_rewrite does not support redirecting to a different protocol,
> and assumes your target is relative and appends it to the base URI.
> You could try to set RewriteBase to / for this scenario.
>
Thank you!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is it possible to redirect user to "market://..." URI?

Posted by Jeroen Geilman <je...@adaptr.nl>.
On 01/10/2012 09:17 AM, linux.il wrote:
>> On Mon, Jan 9, 2012 at 9:31 PM, Jeroen Geilman<je...@adaptr.nl>  wrote:
>>
>>> On 2012-01-09 14:08, linux.il wrote:
>>>
>>> On my website I should redirect Android users to my application on Android Market. What is the optimal way to do this? My first dea>>was
>>>
>>>        RewriteCond %{HTTP_USER_AGENT}  Android [NC]
>>>        RewriteRule ^/$         market://details?id=......
>> There is no market://details application/system/scheme on your apache server - this is a client-side phenomenon.
>> Issue a 301 Redirect to the above URL - you can put anything in a redirect URL.
>> Convert the above into an explicit redirect by appending [R=301] to the RewriteRule.
> Thank you for suggestion. I replaced 302 to 301 return code, but it
> didn't help - browser tries  to open some weird  URL like this:
> http://mysite.com/market://details?.....
>

Perhaps mod_rewrite does not support redirecting to a different 
protocol, and assumes your target is relative and appends it to the base 
URI.
You could try to set RewriteBase to / for this scenario.


-- 
J.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is it possible to redirect user to "market://..." URI?

Posted by "linux.il" <li...@gmail.com>.
>On Mon, Jan 9, 2012 at 9:31 PM, Jeroen Geilman <je...@adaptr.nl> wrote:
>
>> On 2012-01-09 14:08, linux.il wrote:
>>
>> On my website I should redirect Android users to my application on Android Market. What is the optimal way to do this? My first dea >>was
>>
>>       RewriteCond %{HTTP_USER_AGENT}  Android [NC]
>>       RewriteRule ^/$         market://details?id=......
>
> There is no market://details application/system/scheme on your apache server - this is a client-side phenomenon.
> Issue a 301 Redirect to the above URL - you can put anything in a redirect URL.
> Convert the above into an explicit redirect by appending [R=301] to the RewriteRule.

Thank you for suggestion. I replaced 302 to 301 return code, but it
didn't help - browser tries  to open some weird  URL like this:
http://mysite.com/market://details?.....

If I embed the same market URI into some html page and click on this
link - android starts market application as supposed.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Is it possible to redirect user to "market://..." URI?

Posted by Jeroen Geilman <je...@adaptr.nl>.
On 2012-01-09 14:08, linux.il wrote:
>
> On my website I should redirect Android users to my application on 
> Android Market. What is the optimal way to do this? My first idea was
>
> |        RewriteCond %{HTTP_USER_AGENT}  Android [NC]
>         RewriteRule ^/$         market://details?id=......|

There is no market://details application/system/scheme on your apache 
server - this is a client-side phenomenon.
Issue a 301 Redirect to the above URL - you can put anything in a 
redirect URL.
Convert the above into an explicit redirect by appending [R=301] to the 
RewriteRule.

||
>
> But it doesn't work. Is it doable in Apache?
>
> TIA, Vitaly
>


-- 
J.