日期:2014-05-17  浏览次数:20616 次

jsp伪静态的运用,urlwritern,给予评价,谢谢。
在上个星期我的小站http://www.818mimi.com上线了,但是动态的,所以为了让搜索引擎更加喜欢我的小站,于是做了伪静态,但是很遗憾百度一直未收录都一周了,这些天一直在考虑为什么 百度 不收录网站。现在分析如下。 


?1.没有伪静态。 
?2.伪静态做的不完本,不是他所细化的类型 
?3.内容有重复,因为70%的数据来自互联网 


针对以上的缺点我做了一下改善。 
我伪静态的路径如下 
http://818mimi.com/article_2.html ---->表示 该栏目第一页 
http://818mimi.com/article_view_55.html --->表示该栏目的第一页的某个文章。 
所以想改成以下 
article/1/1.html --->栏目首页。 
article/1/1_1.html --->这样以目录的方式存在搜索引擎或许更喜欢。 


关于伪静态使用的是urlwriten 。 
顶下,小弟会将配置文件发上来,并详细说明。谢谢 
过几天改进后会将配置问价写上来。 


不过现在可以看看伪静态效果,虽然有点广告嫌疑。


修改下,发XML文件
[html] view plaincopy
<?xml version="1.0" encoding="utf-8"?>  
<!DOCTYPE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.1//EN"  
  "http://tuckey.org/res/dtds/urlrewrite3.1.dtd">  
  
  
<!--  
  
  
  Configuration file for UrlRewriteFilter  
  http://tuckey.org/urlrewrite/  
  
  
-->  
<urlrewrite>  
  
  
  <rule>  
    <from>^/index.html$</from>  
    <to>/index.jsp</to>  
  </rule>  
  <rule>  
    <from>^/default.html$</from>  
    <to>/default.jsp</to>  
  </rule>  
  <rule>  
    <from>^/article_(.[0-9]*).html$</from>  
    <to>/FwArticleSvt?mid=$1</to>  
  </rule>  
   
  <rule>  
  <from>^/article_view_(.[0-9]*).html$</from>  
  <to>/FwArticleSvt?method=view&aid=$1</to>  
  </rule>  
  <!-- method=list&mid=3&pageIndex=2  
  http://818mimi.com/FwArticleSvt?method=list&mid=2&pageIndex=2  
  -->  
   
  <rule>  
  <from>^/article_list_(.[0-9]*)_(.[0-9]*).html$</from>  
  <to>/FwArticleSvt?method=list&mid=$1&pageIndex=$2</to>  
  </rule>  
   
  <!--  
  <a href="http://818mimi.com/FwProducSvt?pageIndex=2" target="_blank">http://818mimi.com/FwProducSvt?pageIndex=2</a> 
  -->  
  <rule>  
  <from>^/product_(.[0-9]*).html$</from>  
  <to>/FwProducSvt?pageIndex=$1</to>  
  </rule>  
   
  <outbound-rule>  
  <note>  
  The outbound-rule specifies that when response.encodeURL is called (if you are using JSTL c:url)  
  the url /rewrite-status will be rewritten to /test/status/.  
  
  
  The above rule and this outbound-rule means that end users should never see the  
  url /rewrite-status only /test/status/ both in thier location bar and in hyperlinks  
  in your pages.  
  </note>  
  <from>/rewrite-status</from>