IIS Re_write 


װ˵

1IISIsapiɸѡɸѡ reִļѡ Rewrite.dll

2httpd.iniļ

RewriteRule /news/(\d+)\.html /jsp/news\.jsp\?id=$1 [N,I]
ʾnews.jsp?id=95 תnews/95.html

ԴƣиĲӦ(\d+)id=$1id=$2,ȵȡ


ĿǰΪձĶ̬ҳasp,php,jsp,shtml,jhtml,cgi......
һЩԼģ磺aspx,do,index,helloȵȡ
ʽΪnews.asp?id=95ͨre_writeתnews/95.htmlԱgoogleԸҳʶ

Ҫnews.jsp?id=95ӳnews/95.htmlʱֻhttpd.iniļ
RewriteRule /news/(\d+)\.html /news\.jsp\?id=$1 [N,I]
Ͱ /news/95.html ӳ /news.jsp?id=95

ȻӴд<a href='/news/95.html'>95</a>
ͨݿѭȡģôдǣ
while(rs.next())
{
String id = (String)rs.getString('id');
out.print('<a hef='/news/''+id+'.html>');
out.print('95');
out.print('</a>');
}

ڴݷҳôдǣ

More_<%=Page%>_<%=type%>.html עpageǷҳҳtypeͣ
ʽMore_1_95.html

һҳΪMore_2_95.htmlһҳѭǣ
More_3_95.htmlԴơ

Ҫhttpd.iniļ´룺
RewriteRule /More_(\d+)_(\d+)\.html /jsp/more\.jsp\?page=$1&type=$2 [N,I]

Ķ̬жҪݣôӶ(\d+)ɣ£

RewriteRule /More_(\d+)_(\d+)_(\d+)\.html /jsp/more\.jsp\?page=$1&type=$2&type2=$3 [N,I]

ҳʽǣMore_1_95.html