I have two product pages of an ecommerce website: one made with Woocommerce (in WordPress) and one I coded my self in AMP.

Here is the WordPress page, and here is the AMP page. Not taking into account that the two pages are on two different subdomains, how would I redirect mobile users to the AMP version of the page ?

A similar question was asked, but it only specified how to do it for simple pages, not product pages.

Does anyone know how to that?

  • you put some JS code that detect device and screen properties and does the redirect. There is no other way that will scale, but of course it will have a bad UX as you will need to have two http requests instead of one – Mark Kaplun Mar 29 '18 at 16:59
  • Isn't it possible to use a function in functions.php as others have done for pages with if ( is_single() ) ? I'm referring for example to that post: link – Belram nv-sa Mar 30 '18 at 7:17
  • not sure how that link is relevant to redirection. Anyway, proper detection of device type should be done on browser side. Anything done server side will fail when caching is used – Mark Kaplun Mar 30 '18 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.