以下内容来至正在撰写中的《前端SEO优化》文稿。
文章包含以下内容;
1.网页前段常用SEO标记:
常用的搜索引擎优化<Html />标签 | |
---|---|
·标题[标签](Title Tag) | <head>
<title>关键词</title> </head> |
H1,H2,H3,H4,H5,H6 | <h1>最重量级的标题标记</h1>
<h2>次级重量的标记</h2> <h3>仅次级的标记</h3> |
粗体标记Bold, Strong,
(等同价值的[标签]) |
<b>关键词</b>
<strong>关键词</strong> |
Image [a标签]
(XHTML) |
<img src=”keyword.jpg” alt=”关键词” /> |
[超链接-标签] | <a href=”http://www.mysite.com/webpage.html” title=”keyword”>Keyword
in Anchor Text</a> |
[超链接-标签]
(No Followed)未索引Rel |
<a href=”http://www.mysite.com/webpage.html” title=”keyword”
rel=”nofollow”>Keyword in Anchor Text</a> |
2.搜索引擎收录限制及要求:
搜索引擎收录要求及限制–Search Engine Indexing Limits | ||
---|---|---|
*以下规则并不适合所有引擎 | ||
网页文件大小 | 大小不可以超过150kb;去除图片、Css、及其他页面附件文件 | |
链接数量 | 每个网页页面最多不允许超过100个链接。 | |
标题标记Title Tag | 做多不允许超过70个字节; | |
描述关键字 | 最多不允许超过155个字节; | |
URL链接参数 | 最多参数不应操作两个 | 错误的使用方法:
http://www.mysite.com/brands.php? object=1&type=2&kind=3&node=5&arg=6 |
正确的使用方法:
http://www.mysite.com/brands.php?nike |
||
Depth of URL | 最深不应超过4级 | 错误的使用方法:
http://www.mysite.com/people/places/things/ noun/danny/car |
*Best Practice
正确的使用方法: http://www.mysite.com/people/danny/ |
Apache服务器30重定向方法 | |
---|---|
在apache配置文件里面的‘mod_rewrite’方法为启用状态下时;在主机的根目录下面,新建一个名为‘.htaccess’的文件;此文件为配置服务器路径重写文件① |
|
命令 | 描述 |
Redirect 301 /oldpage.html http://www.newdomain.com/
newpage.html |
Redirect single file or directory to a new
file or directory on a different domain |
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mysite.com [NC] RewriteRule (.*) http://www.mysite.com/$1 [L,R=301] |
Redirect http://mysite.com to http://
www.mysite.com. Affects entire domain. |
Entire site:
Redirect 301 / http://www.newdomain.com/ Redirect permanent /old http://www.newdomain.com/new |
Redirect entire domain to a new domain
as either a 301 (recommended) or 302 |
- .htaccess为在linux的主机下面或者VPS的主机下面特有的支持文件;将此文件放置在主机的顶级目录后,方可开启服务器的重写功能,并且在启用mod_rewrite的文件下;虚拟路径重写如:(www.abc.com/home/index.html).
搜索引擎机器人(蜘蛛爬虫) | |
---|---|
Last updated April 29th 2008. Check http://www.user-agents.org/ for updates | |
Google Search | Googlebot/2.1 ( http://www.google.com/bot.html) |
Google Search | Googlebot/2.1 ( http://www.googlebot.com/bot.html) |
Google-Image-Search | Googlebot-Image/1.0 |
Google-Image-Search | Googlebot-Image/1.0 ( http://www.googlebot.com/bot.html) |
MSN Search | msnbot/x.xx ( http://search.msn.com/msnbot.htm) |
MSN Media Search Robot | msnbot-media/1.0 (+http://search.msn.com/msnbot.htm) |
Windows Live Product Search | msnbot-Products/1.0 (+http://search.msn.com/msnbot.htm) |
Microsoft Search for Mobiles | MSNBOT_Mobile MSMOBOT Mozilla/2.0 (compatible; MSIE 4.02; Windows CE; Default) |
Alexa / The Internet Archive | ia_archiver |
Alexa / The Internet Archive | ia_archiver-web.archive.org |
Alexa / The Internet Archive | ia_archiver/1.6 |
Yahoo Blog Search | Yahoo-Blogs/v3.9 (compatible; Mozilla 4.0; MSIE 5.5; http://help.yahoo.com/help/us/ysearch/crawling/
crawling-02.html ) |
Yahoo Multimedia Search | Yahoo-MMAudVid/1.0 (mms dash mmaudvidcrawler dash support at yahoo dash inc dot com) |
Yahoo Product Search | YahooSeeker/1.0 (compatible; Mozilla 4.0; MSIE 5.5; http://help.yahoo.com/help/us/shop/merchant/) |
Yahoo Product Search | YahooSeeker/1.0 (compatible; Mozilla 4.0; MSIE 5.5; http://search.yahoo.com/yahooseeker.html) |
Yahoo Product Search | YahooSeeker/1.1 (compatible; Mozilla 4.0; MSIE 5.5; http://help.yahoo.com/help/us/shop/merchant/) |
Ask/Teoma Search | Mozilla/2.0 (compatible; Ask Jeeves) |
Ask/Teoma Search | Mozilla/2.0 (compatible; Ask Jeeves/Teoma) |
Ask/Teoma Search | Mozilla/2.0 (compatible; Ask Jeeves/Teoma; http://about.ask.com/en/docs/about/webmasters.shtml) |
网页头部meta Robots文件默认的参数 | ||
---|---|---|
<meta name=”ROBOT NAME” content=”ARGUMENTS” /> | ||
ROBOT NAME can be either “robots” for all robots
or the user-agent of a specific robot. See robot user-agent list to the left. |
||
Arguments | ||
noindex | Google, Yahoo, Live,
Ask |
Page Not Indexed |
nofollow | Google, Yahoo, Live,
Ask |
All Links on Page
Become No Followed |
noarchive | Google, Yahoo, Live,
Ask |
Page Not Cached |
noodp | Google, Yahoo, Live | Stops Description and Title
Tag Overwrite by DMOZ (Only for Homepage) |
noydir | Yahoo | Stops Description and
Title Tag Overwrite by Yahoo Directory |
nosnippet | Stops Google from
Generating Description Based on On-page Text |
|
基于服务器根目录下的 robots.txt文件的格式 | ||
Robots.txt 的定义格式 | ||
User-agent: *
Disallow: /privatefolder/ //不允许收录privatefolder下的目录 Disallow: /privatefile.html //不允许收录privatefile.html的内容 User-agent: Googlebot/2.1 //允许google的索引收录 Disallow: /nogoogle.html //不允许收录nogoogle.html的内容 |
||
Robots的文件常规路径: http://www.mysite.com/Robots.txt (使用方法) |
Sitemap文件格式 |
---|
<?xml version=”1.0” encoding=’UTF-8’?>
<urlset xmlns=’http://www.sitemaps.org/schemas/sitemap/0.9’> <url> <loc>http://www.mysite.com/</loc> <lastmod>1987-05-25</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url> </urlset> |
*搜索引擎默认的查找网站地图的文件链接 |
http://www.mysite.com/sitemap.xml
http://www.mysite.com/sitemap.xml.gz http://www.mysite.com/sitemap.gz |
浏览此地址可以帮助你免费生成网站地图 http://www.xml-sitemaps.com/ |
——————————————以上内容来至《前端SEO优化》————————————–
更多内容将会陆续更新上来。
*上文中的内容很多来至工作之余阅读整理后。加之鄙人水平有限,文中难免有不妥之处,敬请读者帮忙指出,在下会非常感谢,并且即时修正