PC端和WAP端SEO优化(不同情况下设置meta使seo得以优化)

wylc123 1年前 ⋅ 547 阅读

一、PC端与WAP端共存的情况下,PC端使用如下META(注意下面的网址要改成当前页面移动端的网址)。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">


<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Cache-Control" content="no-transform" />
<meta name="applicable-device" content="pc">
<meta name="mobile-agent" content="format=html5;url=https://m.chinaz.com/">
<meta name="mobile-agent" content="format=xhtml;url=https://m.chinaz.com/">
<link rel="alternate" media="only screen and(max-width:640px)" href="https://m.chinaz.com/">
<script type='text/javascript'>
var url = window.location;
if(/Android|iPhone|Windows Phone|webOS|iPod|BlackBerry/i.test(navigator.userAgent)){
window.location.href= url.toString().replace('www', "m"); ; 
}
</script>


<title>站长之家</title>
<meta name="keywords" content="站长" />
<meta name="description" content="站长之家" />
</head>

-------------------------------------------------------

 

二、PC端与WAP端共存的情况下,WAP端使用如下META(注意下面的网址要改成当前页面PC端的网址)。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="applicable-device" content="mobile" />
<meta http-equiv="Cache-Control" content="no-transform" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="format-detection" content="telephone=no" />
<link rel="canonical" href="https://www.chinaz.com">

<title>站长之家移动版</title>
<meta name="description" content="站长之家" />
<meta name="keywords" content="站长" />
</head>

-------------------------------------------------------

 

三、只有PC端模板,建议添加如下META(注意下面的网址要改成当前页面PC端的网址)。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="applicable-device" content="pc" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Cache-Control" content="no-transform" />
<link rel="canonical" href="https://www.chinaz.com">

<title>站长之家</title>
<meta name="description" content="站长之家" />
<meta name="keywords" content="站长" />
</head>

-------------------------------------------------------

 

四、只有WAP端模板,建议添加如下META(注意下面的网址要改成当前页面WAP端的网址)。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="applicable-device" content="mobile" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta name="format-detection" content="telephone=no" />
<link rel="canonical" href="https://m.chinaz.com">

<title>站长之家移动版</title>
<meta name="description" content="站长之家" />
<meta name="keywords" content="站长" />
</head>

-------------------------------------------------------

 

五、自适应网站采用如下META,注意把网址改为当前页面的网址。

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<meta name="applicable-device" content="pc,mobile" />
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<meta http-equiv="Cache-Control" content="no-transform" />
<link rel="canonical" href="https://www.chinaz.com">

<title>站长之家</title>
<meta name="description" content="站长之家" />
<meta name="keywords" content="站长" />
</head>


相关文章推荐

全部评论: 0

    我有话说: