欢迎您加入789分类目录! (我要快速审核) (我要上推荐位
当前位置:789分类目录 » 站长资讯 » 站长运营 » 文章详细 订阅RssFeed

最新可用的ASP伪静态规则”hpptd.ini“规则

来源:本站原创 浏览:207次 时间:2015-11-25

实现asp伪静态化首先要服务器空间要支持rewrite重写,然后是URL Rewrite中的httpd.ini伪静态化规则编写,伪静态Rewrite规则编写方法是新建一个httpd.ini,里面写上类似如下代码,再将写好的httpd.ini上传到你网站的根目录下,这里列举的是我司制作一个网站所用到的伪静态规则,当然每个人的网站,规则写得当然不一样,但形式是差不多的, 正如我司常用的伪静态规则,如:

shownews.asp?id=xx可写伪静态规则 
RewriteRule /shownews-([0-9,a-z]*).html /shownews.asp\?id=$1

如后面带参数如BigClassName=一个大类&SmallClassName=一个小类,这样的规则可写成RewriteRule /product-(.*?)-(.*?).html /product.asp\?BigClassName=$1&SmallClassName=$2,这规则里面用到的都是写正则表达式,想了解正在表达式可以在网上看下相关的资料。 

[ISAPI_Rewrite] 
# 3600 = 1 hour 
CacheClockRate 3600 
RepeatLimit 32 
# Block external access to the httpd.ini and httpd.parse.errors files 

RewriteRule /shownews-([0-9,a-z]*).html /shownews.asp\?id=$1 

RewriteRule /showproduct-([0-9,a-z]*).html /showproduct.asp\?id=$1 

RewriteRule /noteshow-([0-9,a-z]*).html /noteshow.asp\?id=$1 

RewriteRule /news-(.*?).html /news.asp\?BigClassName=$1 

RewriteRule /about-(.*?).html /about.asp\?BigClassName=$1 

RewriteRule /product-(.*?).html /product.asp\?BigClassName=$1 

RewriteRule /product-(.*?)-(.*?).html /product.asp\?BigClassName=$1&SmallClassName=$2 

RewriteRule /news-(.*?)-(.*?).html /news.asp\?BigClassName=$1 [N,I,L,O]&SmallClassName=$2 [N,I,L,O] 

RewriteRule /product-(.*?)-([0-9,a-z]*).html /product.asp\?BigClassName=$1 [N,I,L,O]&page=$2 

RewriteRule /news-(.*?)-([0-9,a-z]*).html /news.asp\?BigClassName=$1 [N,I,L,O]&page=$2 

RewriteRule /news-(.*?)-(.*?)-([0-9,a-z]*).html /news.asp\?BigClassName=$1&SmallClassName=$2 [N,I,L,O]&page=$3 

RewriteRule /product-(.*?)-(.*?)-([0-9,a-z]*).html /product.asp\?BigClassName=$1&SmallClassName=$2 [N,I,L,O]&page=$3 

RewriteRule /notebook-(.*?)-(.*?)-([0-9,a-z]*).html /notebook.asp\?BigClassName=$1&SmallClassName=$2 [N,I,L,O]&page=$3 

RewriteRule /notebook-([0-9,a-z]*).html /notebook.asp\?page=$1 

RewriteRule /httpd(?:\.ini|\.parse\.errors).* / [F,I,O] 
# Block external access to the Helper ISAPI Extension 
RewriteRule .*\.isrwhlp / [F,I,O] 
RewriteRule /index.html /index.asp $1 
RewriteRule /news.html /news.asp $1 
RewriteRule /notebook.html /notebook.html $1 

RewriteRule .*\.isrwhlp / [F,I,O] RewriteRule /index.html /index.asp $1RewriteRule /news.html /news.asp $1RewriteRule /notebook.html /notebook.html $1

下面还有种写法,我没用过,是网上别人那复制过来的 

httpd.ini 内容写法如下: 

[ISAPI_Rewrite] 
# 3600 = 1 hour 
CacheClockRate 3600 
RepeatLimit 32 
# Block external access to the httpd.ini and httpd.parse.errors files 
RewriteRule /httpd(?:.ini|.parse.errors).* / [F,I,O] 
# Block external access to the Helper ISAPI Extension 
RewriteRule .*.isrwhlp / [F,I,O] 
RewriteRule ^(.*)/index.asp $1/index.html 
RewriteRule ^(.*)/([0-9]*).html $1/article.asp?id=$2 
RewriteRule ^(.*)/([a-z]*)/([a-z]*)/ $1/list.asp?x=$2&y=$3 

该规则具体说明: 


RewriteRule ^(.*)/index.asp $1/index.html 

是将index.asp 伪静态为index.html

RewriteRule ^(.*)/([0-9]*).html $1/article.asp?id=$2 

文章页伪静态,把article.asp?id=xxx映射成 /xxx.html ,其中xxx为文章ID号,在article.asp中接收id, id=request(“id”), 根据ID由数据库中取数据即可;

RewriteRule ^(.*)/([a-z]*)/([a-z]*)/ $1/list.asp?x=$2&y=$3 

文章列表页伪静态, 把/list.asp?x=$2&y=$3 映射成 如:/news/sports/ 格式,$2对应news,$3对应 sports ,在数据库中取news中sports文章显示即可;其中([a-z]*)代表任意字母,([0-9]*)代表数字;


怎么样,这个httpd.ini的ASP伪静态规则还不错吧~

推荐站点

  • 123目录网123目录网

    中文网站分类目录, 免费收录各种优秀网站, 全人工审核编辑, 为百度、谷歌、有道、搜狗、必应等搜索引擎提供索引参考, 同时也能为站长们推广网站增加排名

    123.klxjz.cn
  • 网站之家网站之家

    免费收录各行业优秀网站,让你的网站快速得到百度、搜狗、360等搜索引擎的收录,同时增加优质外链,提升网站排名。

    wz.klxjz.cn
  • 五洲会海购五洲会海购

    五洲会,官方认证,正品保证,进口商品海外购物商城。轻松购遍海外进口母婴,进口保健,进口美妆等,100%原装进口,海外直采,保税发货,国内售后,网购海外商品有保障。海淘购物首选,五洲会

    www.wzhouhui.com
  • 药方大全网药方大全网

    本站为您搜集整理了大量的验方偏方秘方古方等中药方(中药方剂)八万多个。你是你自己的中医,我是你的中药方!中医中药秘方网,偏方大全愿为您的健康保驾护航。

    www.zhongyf.com
  • 窝读谷中文网窝读谷中文网

    窝读谷中文网是质量最好的中文小说网站,提供奇幻玄幻,武侠仙侠,历史军事,游戏竞技,都市青春言情,科幻灵异悬疑等中文免费小说全文阅读与小说txt下载。

    www.wodugu.com
  • 西瓜电影西瓜电影

    一一影视网(www.yjytv.com)第一时间为你提供西瓜影音2015最新电影大全,最新好看的2015好看的电影电视剧排行榜西瓜影音电影免费在线观看,更新最快的西瓜影音电影电视剧网站!

    www.yjytv.com