Really simple rewrite

Dec 3, 2008 at 12:51 AM
We need to a rewrite to another server (jboss portal) when a request comes in for a particular directory (IIS 6 site).  I've been looking at this for hours, I'm sure it's something small.  Here's what I have thus far:

# IsapiRewrite4.ini
#
# ini file for the ISAPI rewriter.
#
# Tue, 11 Jul 2006  01:49
#

RewriteLog  c:\temp\iirfLog.out
RewriteLogLevel 5

RewriteRule ^/pubs/merchandise/ http://jb-dev4.apa.org:8080/


Here the log:

Tue Dec 02 20:38:07 -  6852 - Initialize: Ionic ISAPI Rewriting Filter (IIRF) v1.2.15 final R3
Tue Dec 02 20:38:07 -  6852 - Initialize: config file 'C:\WINDOWS\system32\inetsrv\IIRF\IsapiRewrite4.ini'
Tue Dec 02 20:38:07 -  6852 - Initialize: File watcher thread created.
Tue Dec 02 20:38:07 -  6852 - GetFilterVersion
Tue Dec 02 20:38:07 -  5052 - FileChangeWatcher(): Enter
Tue Dec 02 20:38:07 -  5052 - FileChangeWatcher: Await()...
Tue Dec 02 20:38:07 -  5052 - AwaitIniChangeAndReinit()...
Tue Dec 02 20:38:07 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:38:07 -  6852 - OnUrlMap: storing physical path (E:\Sites\APA\pubs\merchandise\), in ptr (0x000e1c00)
Tue Dec 02 20:38:07 -  6852 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Tue Dec 02 20:38:07 -  6852 - DoRewrites
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: getting 'url'
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: 128 bytes
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: getting 'url'
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: 19 bytes, result '/pubs/merchandise/'
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: 1 bytes
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: getting 'method'
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: 4 bytes, result 'GET'
Tue Dec 02 20:38:07 -  6852 - DoRewrites: New Url: '/pubs/merchandise/'
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: depth=0
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: Rule 1 : 1 matches
Tue Dec 02 20:38:07 -  6852 - ReplaceServerVariables: InputString='http://jb-dev4.apa.org:8080/' out='http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - GenerateReplacementString: src='/pubs/merchandise/','(null)' ReplacePattern='http://jb-dev4.apa.org:8080/' vec=[[  [  0, 18] [] ] counts=1,0
Tue Dec 02 20:38:07 -  6852 - ApplyCaseConversion: before 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - ApplyCaseConversion: after  'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - GenerateReplacementString: result 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: Result (length 28): http://jb-dev4.apa.org:8080/
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: depth=1
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: Rule 1 : -1 (No match)
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: returning 0
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: returning 1
Tue Dec 02 20:38:07 -  6852 - DoRewrites: Rewrite Url to: 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:38:07 -  6852 - OnUrlMap: storing physical path (E:\Sites\APAhttp:\jb-dev4.apa.org:8080\), in ptr (0x000e1de0)
Tue Dec 02 20:38:07 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:38:07 -  6852 - OnUrlMap: storing physical path (E:\Sites\APA\pubs\merchandise\), in ptr (0x000e1de0)
Tue Dec 02 20:38:07 -  6852 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Tue Dec 02 20:38:07 -  6852 - DoRewrites
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: getting 'url'
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: 128 bytes
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: getting 'url'
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: 19 bytes, result '/pubs/merchandise/'
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: 1 bytes
Tue Dec 02 20:38:07 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: getting 'method'
Tue Dec 02 20:38:07 -  6852 - GetHeader_AutoFree: 4 bytes, result 'GET'
Tue Dec 02 20:38:07 -  6852 - DoRewrites: New Url: '/pubs/merchandise/'
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: depth=0
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: Rule 1 : 1 matches
Tue Dec 02 20:38:07 -  6852 - ReplaceServerVariables: InputString='http://jb-dev4.apa.org:8080/' out='http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - GenerateReplacementString: src='/pubs/merchandise/','(null)' ReplacePattern='http://jb-dev4.apa.org:8080/' vec=[[  [  0, 18] [] ] counts=1,0
Tue Dec 02 20:38:07 -  6852 - ApplyCaseConversion: before 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - ApplyCaseConversion: after  'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - GenerateReplacementString: result 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: Result (length 28): http://jb-dev4.apa.org:8080/
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: depth=1
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: Rule 1 : -1 (No match)
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: returning 0
Tue Dec 02 20:38:07 -  6852 - EvaluateRules: returning 1
Tue Dec 02 20:38:07 -  6852 - DoRewrites: Rewrite Url to: 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:38:07 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:38:07 -  6852 - OnUrlMap: storing physical path (E:\Sites\APAhttp:\jb-dev4.apa.org:8080\), in ptr (0x000e2080)
Tue Dec 02 20:39:05 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:39:05 -  6852 - OnUrlMap: storing physical path (E:\Sites\APA\__utm.gif), in ptr (0x000e2080)
Tue Dec 02 20:39:05 -  6852 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Tue Dec 02 20:39:05 -  6852 - DoRewrites
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree: getting 'url'
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree: 128 bytes
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:39:05 -  6852 - GetHeader_AutoFree: getting 'url'
Tue Dec 02 20:39:05 -  6852 - GetHeader_AutoFree: 260 bytes, result '/__utm.gif?utmwv=4.3&utmn=1331087890&utmhn=cms-dev.apa.org&utmcs=windows-1252&utmsr=1152x864&utmsc=16-bit&utmul=en-us&utmje=1&utmfl=9.0%20r28&utmdt=APA%20Merchandise%20-%20American%20Psychological%20Association&utmhid=1002495213&utmr=-&utmp=/pubs/merchandise/'
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree: 249 bytes
Tue Dec 02 20:39:05 -  6852 - GetServerVariable_AutoFree: result 'utmwv=4.3&utmn=1331087890&utmhn=cms-dev.apa.org&utmcs=windows-1252&utmsr=1152x864&utmsc=16-bit&utmul=en-us&utmje=1&utmfl=9.0%20r28&utmdt=APA%20Merchandise%20-%20American%20Psychological%20Association&utmhid=1002495213&utmr=-&utmp=/pubs/merchandise/'
Tue Dec 02 20:39:05 -  6852 - GetHeader_AutoFree: getting 'method'
Tue Dec 02 20:39:05 -  6852 - GetHeader_AutoFree: 4 bytes, result 'GET'
Tue Dec 02 20:39:05 -  6852 - DoRewrites: New Url: '/__utm.gif?utmwv=4.3&utmn=1331087890&utmhn=cms-dev.apa.org&utmcs=windows-1252&utmsr=1152x864&utmsc=16-bit&utmul=en-us&utmje=1&utmfl=9.0%20r28&utmdt=APA%20Merchandise%20-%20American%20Psychological%20Association&utmhid=1002495213&utmr=-&utmp=/pubs/merchandise/'
Tue Dec 02 20:39:05 -  6852 - EvaluateRules: depth=0
Tue Dec 02 20:39:05 -  6852 - EvaluateRules: Rule 1 : -1 (No match)
Tue Dec 02 20:39:05 -  6852 - EvaluateRules: returning 0
Tue Dec 02 20:39:05 -  6852 - DoRewrites: No Rewrite
Tue Dec 02 20:39:17 -  6452 - DllMain THREAD_DETACH
Tue Dec 02 20:39:33 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:39:33 -  6852 - OnUrlMap: storing physical path (E:\Sites\APA\pubs\merchandise\), in ptr (0x000e3128)
Tue Dec 02 20:39:33 -  6852 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Tue Dec 02 20:39:33 -  6852 - DoRewrites
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree: getting 'url'
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree: 128 bytes
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:39:33 -  6852 - GetHeader_AutoFree: getting 'url'
Tue Dec 02 20:39:33 -  6852 - GetHeader_AutoFree: 19 bytes, result '/pubs/merchandise/'
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree: 1 bytes
Tue Dec 02 20:39:33 -  6852 - GetServerVariable_AutoFree: result ''
Tue Dec 02 20:39:33 -  6852 - GetHeader_AutoFree: getting 'method'
Tue Dec 02 20:39:33 -  6852 - GetHeader_AutoFree: 4 bytes, result 'GET'
Tue Dec 02 20:39:33 -  6852 - DoRewrites: New Url: '/pubs/merchandise/'
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: depth=0
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: Rule 1 : 1 matches
Tue Dec 02 20:39:33 -  6852 - ReplaceServerVariables: InputString='http://jb-dev4.apa.org:8080/' out='http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:39:33 -  6852 - GenerateReplacementString: src='/pubs/merchandise/','(null)' ReplacePattern='http://jb-dev4.apa.org:8080/' vec=[[  [  0, 18] [] ] counts=1,0
Tue Dec 02 20:39:33 -  6852 - ApplyCaseConversion: before 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:39:33 -  6852 - ApplyCaseConversion: after  'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:39:33 -  6852 - GenerateReplacementString: result 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: Result (length 28): http://jb-dev4.apa.org:8080/
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: depth=1
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: Rule 1 : -1 (No match)
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: returning 0
Tue Dec 02 20:39:33 -  6852 - EvaluateRules: returning 1
Tue Dec 02 20:39:33 -  6852 - DoRewrites: Rewrite Url to: 'http://jb-dev4.apa.org:8080/'
Tue Dec 02 20:39:33 -  6852 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Dec 02 20:39:33 -  6852 - OnUrlMap: storing physical path (E:\Sites\APAhttp:\jb-dev4.apa.org:8080\), in ptr (0x000e32f8)
Coordinator
Dec 3, 2008 at 4:04 AM
Edited Dec 3, 2008 at 4:08 AM
for a Redirect, use
RedirectRule
not
RewriteRule

!!!

I inserted a warning about this, I believe it is in the R4 build of v1.2.15.   When your replacement pattern on a RewriteRule begins with http:// or https:// the filter will throw a warning.

Maybe upgrade to R4?