Posts

Showing posts from December, 2019

Redirect users to new URL based on current URL

Image
I'll be using JavaScript and the new feature called URLSearchParams for creating a new url out of the current URL and forward the user to it. Why? My use case was to forward my users to Google Play Store on Android using a link shared through Unity Android application. Now the Play Store link or Market link will not be detected as a browser request but regular text. Market link looks like this: market://details?id=com.shiftescape.meowity&referrer=EFFX This link when opened in computer web browser will lead to nothing. When opened in Google Chrome it would rather make a search. Only other solution is to force the user's browser to open link and not do a search. For this we'll be making a little website which will forward any visitor to our modified link retaining their referral code. Initial Setup XAMPP server installed and Apache module running. For running our JavaScript code let's make a new web page index.html <!DOCTYPE html> <html&