Redirect an HTML5 Wix Site

  • Knowledge Base
  • Mobile Website Builder
  • Redirect an HTML5 Wix Site
  • Duda Support > Mobile Website Builder > Going Live

Overview

To redirect your HTML5 Wix site, you will need to paste the DudaMobile redirection script into an HTML widget on your HTML5 Wix site. The HTML widget can be found with the following steps:

Steps

1. From the left toolbar, click Add (the Plus button).
2. From the Add list, click Apps. Click HTML.
3. From the HTML Settings window, under Mode, click the drop-down menu and select HTML code.


4. Under HTML/embed code, paste the following DudaMobile redirect script (Be sure to replace the <mobile url> text at the end of the redirection script with the URL for your mobile site).

<script>function DM_redirect(MobileURL, Home) {
try {
// avoid loops within mobile site
if (document.getElementById("dmRoot") != null) {
return;
}
var CurrentUrl = location.href
var noredirect = document.location.search;
if (noredirect.indexOf("no_redirect=true") < 0) {
if ((navigator.userAgent.match(/(iPhone|iPod|BlackBerry|Android.*Mobile|BB10.*Mobile|webOS|Windows CE|IEMobile|Opera Mini|Opera Mobi|HTC|LG-|LGE|SAMSUNG|Samsung|SEC-SGH|Symbian|Nokia|PlayStation|PLAYSTATION|Nintendo DSi)/i))) {
if (Home) {
top.location.replace(MobileURL);
} else {
top.location.replace(MobileURL + "?url=" + encodeURIComponent(CurrentUrl));
}
}
}
} catch (err) {}
}
DM_redirect("http://mobile.dudamobile.com/site/sitename");
</script>

5. Click Update.

6. Click outside of the HTML Add on to close the HTML Settings window.

Your HTML5Wix site should now be automatically redirecting your mobile users.

Note: You will need to setup this redirect on all pages which you want to make mobile friendly.

×

Please Log in as a Pro

Priority Phone Support is available exclusively to Pros. Log in to your Pro account now to see our international support numbers.

Log In
Not a Pro? Purchase a Pro plan!