Hello, I’m trying to instantly redirect mobile users to a specific page when they open homepage of my website.
I have inserted following code to my site:
import wixWindow from 'wix-window';
import wixLocation from 'wix-location';
$w.onReady(funtion () {
if(wixWindow.formFactor === "Mobile"){
wixLocation.to.to('https://www.mywebsiteurl.com/mobile-page-name'https://www.mywebsiteurl.com/mobile-page-name');
}
});
Redirect works, but it works only after first loading the original homepage which pauses for a few seconds. I would like users to be directed to my mobile page immediately after they click on my site url without loading the homepage first.
Please post the complete code, I am not very code savvy!
Hi, thanks for the catch. I appreciate your response. However I am able to implement the current code. Issue is the time delay, how can I eliminate that so it is an instant redirect?
@skmedia Thank you for your suggestion. Would that be instead of adding the redirect code, or should the router be added WITH the above mentioned redirect code?
@skmedia Thanks for your suggestions. I am totally thrown off by the router how-to…do you by chance offer email support and I could work with you to create the router I have in mind?
Is there a wix corvid support person who would be willing to help me establish a router for my page today? I am very unfamiliar with code and I can’t manage to understand the tutorial…
@hello77523 It’s not a question of a time out function, it’s that the router code is loaded first in line before the page code itself, and doesn’t have to wait for anything on the page to load.
Yes, you can feel free to email me if you want me to set it up, but I don’t work for Wix, and I don’t work for free either
Look at this example to see how a router works and is set up:
Stripe Payment Processing
Integrate the Stripe Payment processing system into a site. Three levels of user access are demonstrated: visitor, freemium (registered), and premium (paid).