I want to redirect html desktop pages to html mobile pages from the "m" subdomain. I believe I must change something in pages, so I find some settings on other web platforms. The problem is that, does not working.
In desktop pages add this code (change the link):
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.yoursite.com/test.html" />
<link rel="amphtml" href="https://m.yoursite.com/test.html?amp" />
In mobile pages add this (change the link):
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<link rel="canonical" href="https://m.yoursite.com/test.html"/>
<link rel="amphtml" href="https://m.yoursite.com/test.html?amp"/>
<link rel="alternate" media="only screen and (max-width: 640px)" href="https://m.yoursite.com/test.html"/>
<meta name="cXenseParse:pageclass" content="article"/>
<meta name="cXenseParse:url" content="https://m.yoursite.com/test.html"/>
<meta name="robots" content="follow,index,noodp"/>
<meta name="robots" content="max-snippet:-1, max-image-preview:large, max-video-preview:-1"/>
<meta name="referrer" content="origin-when-cross-origin"/>
<meta property="og:url" content="https://m.yoursite.com/test.html" />
Do I need to change something in php? what do I have to do to work?
question from:
https://stackoverflow.com/questions/65938454/adapt-php-web-sites-for-mobile-devices-redirect-to-mobile-subdomain-m 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…