Vague question, I'm not clear what I want, but would like to post anyway

Topics: Developer Forum, User Forum
Sep 5, 2011 at 5:56 AM

hi all

I have a very simple rule

StatusInquiry on
RewriteRule ^/restful/abc/(.*)$ /restful/abc/index.cfm/$1 [L]

which for some reason is not working as intended we want to be left with 2 variables which are in the instance below aps and 666

 

Mon Sep 05 14:09:26 -  6884 - -------------------------------------------------------
Mon Sep 05 14:09:26 -  6884 - Ionic ISAPI Rewriting Filter (IIRF) 2.1.2.0 x86 RELEASE
Mon Sep 05 14:09:26 -  6884 - IIRF was built on: Aug 17 2011 09:58:52
Mon Sep 05 14:09:26 -  6884 - GetLogFile: app:'/LM/W3SVC/1404126978/Root'  new log:'**path**adam\iislog\.3932.log'
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: actual log file '**path**adam\iislog\.3932.log'
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: ini file: '**path**serverCFCs\webservices\Iirf.ini'
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: ini file timestamp: 2011/09/05 14:09:22 AUS Eastern Standard Time
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: cfg(0x027800F8)
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: LogLevel = 5
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: pass 2
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: **path**serverCFCs\webservices\Iirf.ini(1): StatusInquiry on (--) (--)
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: **path**serverCFCs\webservices\Iirf.ini(1): IIRF Status Inquiry is enabled at path '/iirfStatus' for local requests only.
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: **path**serverCFCs\webservices\Iirf.ini(2): RewriteRule (rule 1)  '^/restful/abc/(.*)$'  '/restful/abc/index.cfm/$1'      [L]
Mon Sep 05 14:09:26 -  6884 - ParseRuleModifierFlags: '[L]'
Mon Sep 05 14:09:26 -  6884 - ParseRuleModifierFlags: token 'L'
Mon Sep 05 14:09:26 -  6884 - rule: Last
Mon Sep 05 14:09:26 -  6884 - CountIniLines: ini file **path**serverCFCs\webservices\Iirf.ini (6 lines)
Mon Sep 05 14:09:26 -  6884 - ReadVdirConfig: Done reading INI for the root vdir, found 1 rules (0 errors, 0 warnings) on 6 lines, in 1 modules
Mon Sep 05 14:09:26 -  6884 - GetVdirConfig: Obtain  vdir '/LM/W3SVC/1404126978/Root' (era=4) (rc=1) (Expired=0) (ptr=0x027800F8)...
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: SF_NOTIFY_URL_MAP
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: cfg= 0x027800F8
Mon Sep 05 14:09:26 -  6884 - IsIniChainUpdated: **path**serverCFCs\webservices\Iirf.ini NO
Mon Sep 05 14:09:26 -  6884 - IsIniChainUpdated: return FALSE
Mon Sep 05 14:09:26 -  6884 - IsIniChainUpdated: return FALSE
Mon Sep 05 14:09:26 -  6884 - GetVdirConfig: Obtain  vdir '/LM/W3SVC/1404126978/Root' (era=4) (rc=2) (Expired=0) (ptr=0x027800F8)...
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: SF_NOTIFY_URL_MAP
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: cfg= 0x027800F8
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Mon Sep 05 14:09:26 -  6884 - DoRewrites
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: getting 'url'
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 93 bytes   ptr:0x00103DC8
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 'url' = '/restful/abc/APS/666?reload=true&debug=1&ts=%7Bts%20'2011-09-05%2014:09:26'%7D'
Mon Sep 05 14:09:26 -  6884 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Mon Sep 05 14:09:26 -  6884 - GetServerVariable_AutoFree: 58 bytes
Mon Sep 05 14:09:26 -  6884 - GetServerVariable_AutoFree: result 'reload=true&debug=1&ts=%7Bts%20'2011-09-05%2014:09:26'%7D'
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: getting 'method'
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 5 bytes   ptr:0x000C3678
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 'method' = 'POST'
Mon Sep 05 14:09:26 -  6884 - DoRewrites: New Url, before decoding: '/restful/abc/APS/666?reload=true&debug=1&ts=%7Bts%20'2011-09-05%2014:09:26'%7D'
Mon Sep 05 14:09:26 -  6884 - DoRewrites: Url (decoded): '/restful/abc/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: depth=0
Mon Sep 05 14:09:26 -  6884 - GetServerVariable: getting 'SCRIPT_NAME'
Mon Sep 05 14:09:26 -  6884 - GetServerVariable: 35 bytes
Mon Sep 05 14:09:26 -  6884 - GetServerVariable: result '/restful/abc/APS/666'
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: no RewriteBase
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Rule 1: pattern: ^/restful/abc/(.*)$  subject: /restful/abc/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Rule 1: 2 match
Mon Sep 05 14:09:26 -  6884 - ReplaceServerVariables: alloc 30 bytes
Mon Sep 05 14:09:26 -  6884 - ReplaceServerVariables: in='/restful/abc/index.cfm/$1' out='/restful/abc/index.cfm/$1'
Mon Sep 05 14:09:26 -  6884 - GenerateReplacementString: alloc 98 bytes
Mon Sep 05 14:09:26 -  6884 - ApplyUrlEncoding: in '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - ApplyUrlEncoding: out '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - GenerateReplacementString: result '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Result (length 96): /restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Last Rule
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: returning 1
Mon Sep 05 14:09:26 -  6884 - DoRewrites: Rewrite Url to: '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Mon Sep 05 14:09:26 -  6884 - DoRewrites
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: getting 'url'
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 97 bytes   ptr:0x000E0EC0
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 'url' = '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Mon Sep 05 14:09:26 -  6884 - GetServerVariable_AutoFree: 52 bytes
Mon Sep 05 14:09:26 -  6884 - GetServerVariable_AutoFree: result 'reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: getting 'method'
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 5 bytes   ptr:0x00105E90
Mon Sep 05 14:09:26 -  6884 - GetHeader_AutoFree: 'method' = 'POST'
Mon Sep 05 14:09:26 -  6884 - DoRewrites: New Url, before decoding: '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - DoRewrites: Url (decoded): '/restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: depth=0
Mon Sep 05 14:09:26 -  6884 - GetServerVariable: getting 'SCRIPT_NAME'
Mon Sep 05 14:09:26 -  6884 - GetServerVariable: 35 bytes
Mon Sep 05 14:09:26 -  6884 - GetServerVariable: result '/restful/abc/APS/666'
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: no RewriteBase
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Rule 1: pattern: ^/restful/abc/(.*)$  subject: /restful/abc/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Rule 1: 2 match
Mon Sep 05 14:09:26 -  6884 - ReplaceServerVariables: alloc 30 bytes
Mon Sep 05 14:09:26 -  6884 - ReplaceServerVariables: in='/restful/abc/index.cfm/$1' out='/restful/abc/index.cfm/$1'
Mon Sep 05 14:09:26 -  6884 - GenerateReplacementString: alloc 108 bytes
Mon Sep 05 14:09:26 -  6884 - ApplyUrlEncoding: in '/restful/abc/index.cfm/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - ApplyUrlEncoding: out '/restful/abc/index.cfm/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - GenerateReplacementString: result '/restful/abc/index.cfm/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Result (length 106): /restful/abc/index.cfm/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: Last Rule
Mon Sep 05 14:09:26 -  6884 - EvaluateRules: returning 1
Mon Sep 05 14:09:26 -  6884 - DoRewrites: Rewrite Url to: '/restful/abc/index.cfm/index.cfm/APS/666?reload=true&debug=1&ts=%7Bts '2011-09-05 14:09:26'}'
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: SF_NOTIFY_URL_MAP
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: cfg= 0x027800F8
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: SF_NOTIFY_URL_MAP
Mon Sep 05 14:09:26 -  6884 - HttpFilterProc: cfg= 0x027800F8

Coordinator
Sep 5, 2011 at 1:57 PM

It's doing what I would expect.

The (.*)$ in your pattern is capturing everything after /restful/abc/ in your incoming URL, until the end of the string, which includes aps/666 but also includes the query string.  That is what IIRF is doing. 

If you want to exclude the query string in the thing you capture, then use ([^\?]*) , and omit the $ end-of-string assertion.  That says to capture a consecutive sequence of characters, none of which is ? . which in english is, "everything up to the query string, if any".

Also: I strongly suggest that you use a regex tester tool to aid you in evaluating whether your regexes are doing what you want. A free one is available here: http://cheeso.members.winisp.net/srcview.aspx?file=WinForms-RegexTester.zip

you wrote:

> which for some reason is not working as intended we want to be left with 2 variables

I'm not clear on what that means.  2 variables where?  what sort of variables?  If you choose to rephrase the question, you will need to elaborate and clarify. 

Stepping back - I don't respond to these questions instantly. It could be 8 hours, or 38 hours or more before I check this forum again.  Also my effort is completely voluntary.  You want to do everything you can, to insure I have all the information necessary, in order for me to CHOOSE to answer the quesiton, and then to actually provide a useful answer to the question.  "we want to be left with 2 variables" is completely unclear to me.  I have no idea what that means.  Maybe a few sentences from you, which would take... oh, 3 minutes to write...just guessing, would make your question clearer and significantly improve your chances of (a) getting me to answer and (b) getting a usable response the first time round.  Maybe an example or two of what you expect, to clarify.  Or, because you're in a hurry, you skip the 3 minutes now and post the vague question, then wait 8-38 hours for my "huh?" question, then spend the 3 minutes THEN, to ask a clearer question.

your choice.

also do me a favor... if you do choose to ask again, take the time to use punctuation - you know, commas, periods, that sort of thing. It helps make the communication clear.  It will help me.