apache .htaccess
RewriteBase / #目录名字
RewriteEngine on #打开引擎
RewriteRule #匹配规则 #跳转路径
例:
RewriteBase /
RewriteEngine on
RewriteRule ^test.html$ test.aspx
RewriteRule ^test-([0-9]+).html$ test.aspx?id=$1
RewriteRule ^test-([0-9]+)-([0-9]+).html$ test.aspx?pid=$1&id=$2
iis httpd.ini
[ISAPI_Rewrite]
# 3600 = 1 hour
CacheClockRate 3600
RepeatLimit 32
# Protect httpd.ini and httpd.parse.errors files
# from accessing through HTTP
#参考
RewriteRule ^(.*)/archiver/((fid|tid)-[0-9]+\.html)\?*(.*)$ $1/archiver/index\.php\?$2&$4
RewriteRule ^(.*)/forum-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/forumdisplay\.php\?fid=$2&page=$3&$4
RewriteRule ^(.*)/thread-([0-9]+)-([0-9]+)-([0-9]+)\.html\?*(.*)$ $1/viewthread\.php\?tid=$2&extra=page\%3D$4&page=$3&$4
RewriteRule ^(.*)/space-(username|uid)-(.+)\.html\?*(.*)$ $1/space\.php\?$2=$3&$4
RewriteRule ^(.*)/tag-(.+)\.html\?*(.*)$ $1/tag\.php\?name=$2&$3
#例
RewriteRule ^(.*)/default\.html $1/default\.asp
RewriteRule ^(.*)/info\.html\?base_id=(.*) $1/info\.asp\?base_id=$2
RewriteRule ^(.*)/info\.html\?base_id=(.*)&second_id=(.*) $1/info\.asp\?base_id=$2&second_id=$3
RewriteRule ^(.*)/display\.html\?id=(.*) $1/display\.asp\?id=$2