配置规则如下
RewriteRule ^/Pt/([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+).html /Product/plist.aspx?CateID=$1&c=$2&m=$3&d=$4&t=$5&ct=$6&p=$7&s=$8&b=$9&page=$10 [I,L]
输入地址如下:
http://xxx/24_1_0_0_0_0_0_0_0_1.html
日志如下:
Tue Nov 15 10:33:29 - 10384 - LogFile re-opened.
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit: TerminateWatch = FALSE
Tue Nov 15 10:33:29 - 10384 - FileChangeWatcher(): Await returns (TerminateWatch= FALSE)
Tue Nov 15 10:33:29 - 10384 - FileChangeWatcher: Await()...
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit()...
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit: watcher got something...
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit: Detected change in file 'IsapiRewrite4.ini'
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit: Detected change in the ini file 'D:\WINDOWS\system32\inetsrv\IsapiRewrite4\IsapiRewrite4.ini'
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit: Ionic ISAPI Rewriting Filter (IIRF) v1.2.15 final R3
Tue Nov 15 10:33:29 - 10384 - ReadConfig
Tue Nov 15 10:33:29 - 10384 - LogFile re-opened.
Tue Nov 15 10:33:29 - 10384 - ReadConfig: new log file name: 'D:\IsapiRewrite4\log\iirfLog3.out.7844.log'
Tue Nov 15 10:33:29 - 10384 - ReadConfig: line 13: RewriteLogLevel 5
Tue Nov 15 10:33:29 - 10384 - ReadConfig: setting LogLevel to 5
Tue Nov 15 10:33:29 - 10384 - ReadConfig: line 24: RewriteRule (rule 1) '^/Pt/([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+).html' '/Product/plist.aspx?CateID=$1&c=$2&m=$3&d=$4&t=$5&ct=$6&p=$7&s=$8&b=$9&page=$10' [I,L]
Tue Nov 15 10:33:29 - 10384 - ReadConfig: not a duplicate rule...
Tue Nov 15 10:33:29 - 10384 - ParseRuleModifierFlags: '[I,L]'
Tue Nov 15 10:33:29 - 10384 - ParseRuleModifierFlags: token 'I'
Tue Nov 15 10:33:29 - 10384 - rule: Case Insensitive match
Tue Nov 15 10:33:29 - 10384 - ParseRuleModifierFlags: token 'L'
Tue Nov 15 10:33:29 - 10384 - rule: Last
Tue Nov 15 10:33:29 - 10384 - ReadConfig: Done reading, found 1 rules (0 errors, 0 warnings) on 28 lines
--------------------------------------------
Tue Nov 15 10:33:29 - 10384 - LogFile re-opened.
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit: TerminateWatch = FALSE
Tue Nov 15 10:33:29 - 10384 - FileChangeWatcher(): Await returns (TerminateWatch= FALSE)
Tue Nov 15 10:33:29 - 10384 - FileChangeWatcher: Await()...
Tue Nov 15 10:33:29 - 10384 - AwaitIniChangeAndReinit()...
Tue Nov 15 10:33:33 - 10428 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Nov 15 10:33:33 - 10428 - OnUrlMap: storing physical path (F:\Work\SVN\VoShop\Pt\24_1_0_0_0_0_0_0_0_1.html), in ptr (0x0fbef6b8)
Tue Nov 15 10:33:33 - 10428 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Tue Nov 15 10:33:33 - 10428 - DoRewrites
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree: getting 'url'
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree: 128 bytes
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree: result ''
Tue Nov 15 10:33:33 - 10428 - GetHeader_AutoFree: getting 'url'
Tue Nov 15 10:33:33 - 10428 - GetHeader_AutoFree: 30 bytes, result '/Pt/24_1_0_0_0_0_0_0_0_1.html'
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree: 1 bytes
Tue Nov 15 10:33:33 - 10428 - GetServerVariable_AutoFree: result ''
Tue Nov 15 10:33:33 - 10428 - GetHeader_AutoFree: getting 'method'
Tue Nov 15 10:33:33 - 10428 - GetHeader_AutoFree: 4 bytes, result 'GET'
Tue Nov 15 10:33:33 - 10428 - DoRewrites: New Url: '/Pt/24_1_0_0_0_0_0_0_0_1.html'
Tue Nov 15 10:33:33 - 10428 - EvaluateRules: depth=0
Tue Nov 15 10:33:33 - 10428 - EvaluateRules: Rule 1 : 0 (The output vector (30 slots) was not large enough)
Tue Nov 15 10:33:33 - 10428 - EvaluateRules: returning 0
Tue Nov 15 10:33:33 - 10428 - DoRewrites: No Rewrite
阿哥,你的正则不对啊,. 是元字符啊,应该这样吧
RewriteRule ^/Pt/([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)_([^/]+)\.html