I have included the following script in the head section of my webpage:
<script type="text/javascript">
if (screen.width <= 800) {
window.location = "http://m.domain.com";
}
</script>
On the mobile version of my site, I have a button labeled "Main Site". How can I make it so that when users click on this button, they are directed to my main site without being redirected back to the mobile version?
Additionally, I want users to be taken to the main site only once. After that, if they revisit the website, I would like them to land on the mobile version.