全国咨询热线:400-865-6067
当前位置:首页 > 行业研究 >

引擎力Google Seo专家整理CSS代码编写要求

来源:引擎力策划部

发布日期:

  1. 头部

<html xml:lang="en" lang="en" xmlns:fb="http://ogp.me/ns/fb#">

<head>

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

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<title>demo</title>

<meta property="og:title" content="demo" />

<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">

<meta property="og:image" content="https://www.woorank.com/assets/img/og-image.png" />

<meta name="description" content="demo" />

<meta property="og:description" content="demo" />

<link rel="canonical" href="" />

<link rel="shortcut icon" href="/favicon.ico" type="image/ico" />

<meta name="robots" content="noodp" />

  1. 404设置.htaccess文件加入以下代码ErrorDocument 404 /404.html
  2. 301设置.htaccess文件加入以下代码

RewriteEngine On

RewriteCond %{HTTP_HOST} !^www.website.com$

RewriteRule ^/?(.*) http://www.website.com/$1 [QSA,R=301,L]

  1. Windows服务器下web.config文件配置404和www301跳转参考如下

<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

<rule name="Imported Rule a1" stopProcessing="true">

                    <match url="^(.*)$" ignoreCase="false" />

                    <conditions logicalGrouping="MatchAll">

                        <add input="{HTTP_HOST}" pattern="^www.website.com$" negate="true" />

                    </conditions>

                    <action type="Redirect" url="http://www.website.com/{R:1}" redirectType="Permanent" />

                </rule>

              </rules>

        </rewrite>

        <httpErrors>

            <remove statusCode="404" subStatusCode="-1" />

            <error statusCode="404" prefixLanguageFilePath="" path="/404.html" responseMode="ExecuteURL" />

        </httpErrors>

    </system.webServer>

</configuration>

  1. Breadcrumb设置参考代码

<div xmlns:v="http://rdf.data-vocabulary.org/#">

  <span typeof="v:Breadcrumb">

    <a href="http://www.example.com/books" rel="v:url" property="v:title">

      Books

    </a> ›

    <span rel="v:child" typeof="v:Breadcrumb">

      <a href="http://www.example.com/books/authors" rel="v:url" property="v:title">

        Authors

      </a> ›

      <span rel="v:child" typeof="v:Breadcrumb">

        <a href="http://www.example.com/books/authors/stephenking" rel="v:url" property="v:title">

          Stephen King

        </a> ›

      </span>

    </span>

  </span>

</div>

  1. Viewport设置

<meta name=viewport content="width=device-width, initial-scale=1">

  1. 判断是手机访问网站跳转到wap页面代码

<script type="text/javascript">

       try {

       var urlhash = window.location.hash;

       if (!urlhash.match("fromapp"))

       {

       if ((navigator.userAgent.match(/(iPhone|iPod|Android|ios|iPad)/i)))

       {

       window.location="http://wap.website.com";

       }

       }

       }

       catch(err)

       {

       }</script>

<>8.手机端和电脑端加载不同css代码

<?php

if(preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|phone|android)/i',strtolower($_SERVER['HTTP_USER_AGENT']))){

echo '<link href="http://www.hswaterslide.com/wood/css/wooddawn_m.css" rel="stylesheet">';

}

else{

echo '<link href="http://www.hswaterslide.com/wood/css/wooddawn.css" rel="stylesheet">';

}?>

 

最新新闻
关于引擎力关于引擎力
谷歌SEM优化师实战总结:谷歌广告现在可以自动完成的5件事(下篇)谷歌SEM优化师实战总结:谷歌广告现在可以自动完成的5件事(下篇)
谷歌SEM优化师实战总结:谷歌广告现在可以自动完成的5件事(上篇)谷歌SEM优化师实战总结:谷歌广告现在可以自动完成的5件事(上篇)
Google SEO优化师实战总结:创建更好的用户体验Google SEO优化师实战总结:创建更好的用户体验
谷歌SEO优化师实战总结:不会直接影响您的谷歌排名的8件事谷歌SEO优化师实战总结:不会直接影响您的谷歌排名的8件事
让您的PPC广告更难忘的3个步骤让您的PPC广告更难忘的3个步骤
谷歌优化大型网站抓取路径:内部链接和移动优先谷歌优化大型网站抓取路径:内部链接和移动优先
过时SEO战术以及最新谷歌优化建议过时SEO战术以及最新谷歌优化建议
外贸网站引流的方法外贸网站引流的方法
排名2:谷歌优化之内容研究排名2:谷歌优化之内容研究

想要网站优化推广,请留言,引擎力SEO专家将会尽快和您联系!

  • *您的姓名:

    先生
    女士
  • *所在城市:

  • *您的联系电话:

  • 您的QQ:

  • 咨询问题:


电话拨打
mb 在线咨询