2011年7月1日,90后高鹏个人博客开始它的启程之路,对于菜鸟的我,花了整整一个通宵把个人博客网站遇到的问题解决了,在此之间,我遇到的一些网站问题,这些问题可能也会是新人们遇到的,或准备建站的新人朋友们的问题,写几点在建站前后要注意的几点,希望能帮助到新人朋友们建站时遇到的困难,帮助别人就是等于帮助自己:
一、网站程序版本的选择:我的博客网站程序用的是 wordpress,它有着强大的功能,目前是主流的搭建Blog平台程序。我用的空间后台有直接上传wp程序的功能,比Ftp上传快,我就选择了它,它 是3.1.2版本,但与我使用的模板不能在这个版本中发挥正常,它适应wordpress3.1.1版本,所以要大家注意了,版本的问题很重要,我一开始 网站问题都解决不了,最后发现是版本的问题。为什么呢?
模板对程序的兼容性不一样,我们使用有时候会忽略模 板适用哪个版本的wp,就随便使用,然后出现一系列的问题,解决不了,wordpress版本更新很快,但是模板更新程度是比较慢的,特别是一些个人编辑 的模板,有些模板是不适应新版本的wordpress,这样会导致网站出问题,没必要每次都要用新版本,适当的选择,才是硬道理。
二、网站url的设置:wordpress是动态,动态对于网站的收录、排名都影响,大部分都要实现伪静态,这样有利于网站优化,如何区分动态还是静态的,很简单,看网站网址中是否有“?”,有就是动态,没有就是静态。
1、要看你使用的主机是Linx还是windows,wordpress在Linux主机上表现强于Windows主机,我用的是windows主机,说下该如何实现伪静态呢?
要建立httpd.ini文件,这个文件放在网站的根目录下,这个httpd.ini规则目前主用的有两种,大家适当选择。
(1)
[ISAPI_Rewrite]# Protect httpd.ini and httpd.parse.errors files# from accessing through HTTP# # 形式:/PostID.html# # 自定义链接 /%post_id%.htmlRewriteRule /Tags/(.*) /index\.php\?tag=$1RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap|link|help|security|%e5%85%b3%e4%ba%8e) /index\.php\?pagename=$1RewriteRule /Category/(.*)/(feed|rdf|rss|rss2|atom)/?1&feed=$2RewriteRule /Category/?(.*) /index\.php\?category_name=$1RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?1&feed=$2RewriteRule /author/?(.*) /index\.php\?author_name=$1RewriteRule /rss.xml /wp-feed\.php/\?feed=rss2RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2RewriteRule /([0-9]+).html /index\.php\?p=$1 [I]RewriteRule /page/(.*)/?s=(.*) /index\.php\?s=1RewriteRule /page/(.*) /index\.php\?paged=$1RewriteRule /date/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?1&monthnum=3&name=5RewriteRule /date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?1&monthnum=3&page= /index\.php\?year=2&page=$3RewriteRule /([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1RewriteRule /([0-9]+).html/trackback /wp-trackback\.php\?p=$1
这个是90后高鹏博客目前用的规则。
(2)
[ISAPI_Rewrite] # Protect httpd.ini and httpd.parse.errors files # from accessing through HTTP # # 形式:/PostID.html # # 自定义链接 /%post_id%.html RewriteRule /Tags/(.*) /index\.php\?tag=$1 RewriteRule /(about|contact|about-copyright|favor|archives|tags|sitemap|link|help|security|%e5%85%b3%e4%ba%8e) /index\.php\?pagename=$1 RewriteRule /Category/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?category_name=$1&feed=$2 RewriteRule /Category/?(.*) /index\.php\?category_name=$1 RewriteRule /author/(.*)/(feed|rdf|rss|rss2|atom)/?$ /wp-feed\.php\?author_name=$1&feed=$2 RewriteRule /author/?(.*) /index\.php\?author_name=$1 RewriteRule /rss.xml /wp-feed\.php/\?feed=rss2 RewriteRule /feed/?$ /wp-feed\.php/\?feed=rss2 RewriteRule /comments/feed/?$ /wp-feed\.php/\?feed=comments-rss2 RewriteRule /([0-9]+).html /index\.php\?p=$1 [I] RewriteRule /page/(.*)/?s=(.*) /index\.php\?s=$2&paged=$1 RewriteRule /page/(.*) /index\.php\?paged=$1 RewriteRule /date/([0-9]{4})([0-9]{1,2})([0-9]{1,2})/([^/]+)/?([0-9]+)?/?$ /index\.php\?year=$1&monthnum=$2&day=$3&name=$4&page=$5 RewriteRule /date/([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&day=$3&page=$4 RewriteRule /date/([0-9]{4})/([0-9]{1,2})/?$ /index\.php\?year=$1&monthnum=$2&page=$3 RewriteRule /([0-9]+).html/(feed|rdf|rss|rss2|atom) /index\.php\?feed=rss2&p=$1 RewriteRule /([0-9]+).html/trackback /wp-trackback\.php\?p=$1
这是另一种规则。看你选择哪个,适当选择,东西是死的,人是活的。
2、网站后台固定链接的设置。链接的种类有许多种,但有利于网站优化的链接,我认为有三种:
(1)/%category%/%postname%.html 目录+文章名
(2)/%category%/%post_id%.html 目录+文章ID
(3)/%postname%.html 文章名
3、90后高鹏博客选择的是第二种。在这当中,如果 朋友们url设置中有目录的要注意了,你会发现你的网址中会多出category这层目录,相当于你多了一层目录,这个目录是没必要的,不利于网站的优 化,给大家说个方法去掉category这层目录,利用“WP No Category Base”插件,去下载个,开启就可以了,很方便。
4、说下“/%postname%.html ”文章名的设置,如果朋友们设置了这样的链接,中间有时url会出现乱码的情况,原因是网址对中文不识别,如何解决这样的情况呢?推荐用“Cos_Slug_Translator”插件,它的作用是将标题的中文自动翻译成英语,不需要每次翻译,自动实现翻译功能,很方便,同时又利于seo优化。
以上两点,希望新人朋友们在建站的时候能注意下,减少在方面过多的浪费时间,提高工作效率,得到好的效果。
2011-7-7
本文首发地址90后高鹏-网络数据分析博客 http://www.9gaopeng.com/(转载请保留)