The growing significance of owning a mobile-friendly website has motivated people to switch from traditional web portal to one which can operate on multiple mobile devices with varying screen sizes and resolutions. If you’re operating a Magento mobile website, then it becomes quite critical for you to redirect your users to the mobile theme for your site.
Magento E-commerce development has been flourishing in the recent years. More and more entrepreneurs have switched to Magento mobile theme for promoting their business products and services. Even the industry biggie like Zalando has used mobile theme for its corporate website. Continue reading this post to know more about redirecting users to your Magento mobile website.
Also Read: How To Go About Outsourcing Web Design Through Social Media
.htaccess – A viable means of redirecting visitors to the site’s mobile theme
The code snippet associated with Magento .htaccess redirect to mobile theme is displayed below:
You need to start off with creating a store view from the main website. For this, you can use the JS-Redirection-Mobile-Site script available on GitHub. Simply download the redirection-mobile.js, highlight the text, copy it and create a new text document within the folder called “js” and name the folder redirect-to-mobile.js. Now, just paste the below code in the <head> section of the page that you’re looking to redirect your visitors to:
It is recommended to place the above code in the page column of phtml files. But, you can decide a suitable place for the given code snippet on your own.
Irrespective of whether you’ve chosen to hire a Magento developer or have created a Magento portal by yourself, managing multiple redirects for your Magento mobile website is something you need to pay special attention to. I’m sure the above post would have allowed you to dig deeper into the handy techniques of redirecting visitors for your Magento web portal to pages you want them to land on.