htaccess rewriterule to special url structure doesn’t work

I want to open remote site page in Chrome (mobile), so came up with this idea;

<a href="intent://remotesite.com/cancel.php?id=123456#Intent;scheme=https;package=com.android.chrome;end">CANCEL</a>

Works pretty awesome, when you use it on other browser, for example Samsung browser, it opens it on chrome and passes the id variable.

But why need users to click when it can be done automatically ? So I created this link scheme to check it works on htaccess

Redirect 301 /cancel intent://remotesite.com/cancel.php?id=123456#Intent;scheme=https;package=com.android.chrome;end

Works if used as currentsite.com/cancel and it opens remotesite on chrome. However we have a problem, it lacks of passing id. So I have tried to pass id using RewriteRule;

RewriteRule id/(.+)$ intent://remotesite.com/cancel.php?id=$1#Intent;scheme=https;package=com.android.chrome;end [L,R=301]

However, It opens url but not with chrome as expected. Opens in samsung browser as this;

currentsite.com/intent://remotesite.com/cancel.php?id=$1#Intent;scheme=https;package=com.android.chrome;end



Read more here: https://stackoverflow.com/questions/67394010/htaccess-rewriterule-to-special-url-structure-doesnt-work

Content Attribution

This content was originally published by user3304007 at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: