技术文章
当前位置:首页 > 技术文章

httpd.ini伪静态地址重写实例

httpd.ini伪静态地址重写实例,部分URL重写规则参考如下:

[ISAPI_Rewrite]
CacheClockRate 3600
RepeatLimit 32
 
RewriteRule ^(.*)/specials0-(\d+)\.aspx\?*(.*)$ $1/specials\.aspx\?page=$2
RewriteRule ^(.*)/searched-(\d+)-(\w+)\.aspx\?*(.*)$ $1/searched\.aspx\?page=$2&key=$3
RewriteRule ^(.*)/promotions0-(\d+)-(\w+)-(\w+)\.aspx\?*(.*)$ $1/promotions\.aspx\?page=$2&orderby=$3&type=$4
RewriteRule ^(.*)/promotions0-(\d+)\.aspx\?*(.*)$ $1/promotions\.aspx\?page=$2
RewriteRule ^(.*)/productpl(\d+)-(\d+)\.aspx\?*(.*)$ $1/productpl\.aspx\?id=$2&page=$3
RewriteRule ^(.*)/news(\d+)-(\d+)\.aspx\?*(.*)$ $1/news\.aspx\?id=$2&page=$3
RewriteRule ^(.*)/hot0-(\d+)-(\w+)-(\w+)\.aspx\?*(.*)$ $1/hot\.aspx\?page=$2&orderby=$3&type=$4
RewriteRule ^(.*)/hot0-(\d+)\.aspx\?*(.*)$ $1/hot\.aspx\?page=$2
RewriteRule ^(.*)/catalog(\d+)-(\d+)\.aspx\?*(.*)$ $1/catalog\.aspx\?id=$2&page=$3
RewriteRule ^(.*)/freeshipping0-(\d+)\.aspx\?*(.*)$ $1/freeshipping\.aspx\?page=$2
RewriteRule ^(.*)/catalog(\d+)-(\d+)\.aspx\?*(.*)$ $1/catalog\.aspx\?id=$2&page=$3
RewriteRule ^(.*)/cent0-(\d+)\.aspx\?*(.*)$ $1/cent\.aspx\?page=$2
RewriteRule ^(.*)/new(\d+)\.aspx\?*(.*)$ $1/new\.aspx\?id=$2
RewriteRule ^(.*)/news(\d+)\.aspx\?*(.*)$ $1/news\.aspx\?id=$2
RewriteRule ^(.*)/content(\d+)\.aspx\?*(.*)$ $1/content\.aspx\?id=$2
RewriteRule ^(.*)/article(\d+)\.aspx\?*(.*)$ $1/article\.aspx\?id=$2
RewriteRule ^(.*)/articles(\d+)\.aspx\?*$ articles\.aspx\?id=$2
RewriteRule ^(.*)/help(\d+)\.aspx\?*(.*)$ $1/help\.aspx\?id=$2
RewriteRule ^(.*)/helps(\d+)\.aspx\?*(.*)$ $1/helps\.aspx\?id=$2

以上实例在大部分虚拟主机上都可正常使用,如有特殊要求,请灵活修改。