Hi, I am trying to have two separate home pages for my site one for mobile and one for desktop, and the only way i ca do this is via a router. I have this bit of code:
import {redirect} from 'wix-Router';
import wixWindow from 'wix-Window';
export function home_Router(request) {
if(wixWindow.formFactor === "Mobile"){
return redirect("mywebsite.com/mobilepage", "301")
}
}
but I can't get it to work and i don't really get what the prefix should be. When I create a router it asks me for a prefix which i though was the bit after .com "/home" but when i write home as the name of my prefix it says theres a prefix already called this. I am completely stuck. I have tried to ring up but they don't know anything about code and there are posts of people on here looking for the same thing but when every i copy the code in it doesn't work.
If anyone can help me on this it would be amazing as i am at a total loss at what to do.
top of page
Important forum update
This forum is migrating to one unified Wix community forum starting July 26th, and will be read-only during the process.
Wishlist Page is the official platform for requesting new features. You can vote, comment, and track the status of the requested features.
bottom of page