is not a file; not a directory ?

Mar 12, 2009 at 2:46 PM
Edited Mar 12, 2009 at 2:58 PM
Isn't the lines below supposed to rewrite accordingly? If the path is a file then rewrite to /file.html, and if the path is a directory then rewrite to /directory.html ? At least on my IIS6 box it does not seem to do anything.

Basically I'm trying to implement a rewrite rule starting from the root that only applies IF the requested URL is a directory.

RewriteLogLevel 7
RewriteLog  E:\iirf_log\iirf.log

RewriteCond %{REQUEST_FILENAME}    -f
RewriteRule    ^.*$        /file.html

RewriteCond %{REQUEST_FILENAME}    -d
RewriteRule    ^.*$        /directory.html

snippet from iirf.log
--/
Thu Mar 12 15:45:15 -  3188 - Initialize: Ionic ISAPI Rewriting Filter (IIRF) v1.2.15 final R3
Thu Mar 12 15:45:15 -  3188 - Initialize: config file 'E:\iirf\IsapiRewrite4.ini'
Thu Mar 12 15:45:15 -  3188 - Initialize: File watcher thread created.
Thu Mar 12 15:45:15 -  3188 - GetFilterVersion
Thu Mar 12 15:45:15 -  3216 - FileChangeWatcher(): Enter
Thu Mar 12 15:45:15 -  3216 - FileChangeWatcher: Await()...
Thu Mar 12 15:45:15 -  3216 - AwaitIniChangeAndReinit()...
Thu Mar 12 15:45:15 -  3188 - HttpFilterProc: SF_NOTIFY_URL_MAP
Thu Mar 12 15:45:15 -  3188 - OnUrlMap: storing physical path (E:\webdav\Kesko\pdf\), in ptr (0x000c1008)
Thu Mar 12 15:45:15 -  3188 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Thu Mar 12 15:45:15 -  3188 - DoRewrites
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree: getting 'url'
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree: 128 bytes
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree: result ''
Thu Mar 12 15:45:15 -  3188 - GetHeader_AutoFree: getting 'url'
Thu Mar 12 15:45:15 -  3188 - GetHeader_AutoFree: 12 bytes, result '/Kesko/pdf/'
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree: 1 bytes
Thu Mar 12 15:45:15 -  3188 - GetServerVariable_AutoFree: result ''
Thu Mar 12 15:45:15 -  3188 - GetHeader_AutoFree: getting 'method'
Thu Mar 12 15:45:15 -  3188 - GetHeader_AutoFree: 4 bytes, result 'GET'
Thu Mar 12 15:45:15 -  3188 - DoRewrites: New Url: '/Kesko/pdf/'
Thu Mar 12 15:45:15 -  3188 - EvaluateRules: depth=0
Thu Mar 12 15:45:15 -  3188 - EvaluateRules: Rule 1 : 1 matches
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: getting 'REQUEST_FILENAME'
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: special variable name
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: 20 bytes
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: result 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - ReplaceServerVariables: InputString='%{REQUEST_FILENAME}' out='E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: ts1 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - GenerateReplacementString: src='/Kesko/pdf/','(null)' ReplacePattern='E:\webdav\Kesko\pdf\' vec=[[  [  0, 11] [] ] counts=1,0
Thu Mar 12 15:45:15 -  3188 - ApplyCaseConversion: before 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - ApplyCaseConversion: after  'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - GenerateReplacementString: result 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: checking 'E:\webdav\Kesko\pdf\' against pattern '-f'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: cond->SpecialConditionType= 'f'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: Special: it is not a file; not a directory
Thu Mar 12 15:45:15 -  3188 - EvalCondition: Special, retVal= false
Thu Mar 12 15:45:15 -  3188 - EvaluateCondition: Child is NULL
Thu Mar 12 15:45:15 -  3188 - EvalCondition: returning FALSE
Thu Mar 12 15:45:15 -  3188 - EvalConditionList: rule 1, FALSE, Rule does not apply
Thu Mar 12 15:45:15 -  3188 - EvaluateRules: Rule 2 : 1 matches
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: getting 'REQUEST_FILENAME'
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: special variable name
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: 20 bytes
Thu Mar 12 15:45:15 -  3188 - GetServerVariable: result 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - ReplaceServerVariables: InputString='%{REQUEST_FILENAME}' out='E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: ts1 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - GenerateReplacementString: src='/Kesko/pdf/','(null)' ReplacePattern='E:\webdav\Kesko\pdf\' vec=[[  [  0, 11] [] ] counts=1,0
Thu Mar 12 15:45:15 -  3188 - ApplyCaseConversion: before 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - ApplyCaseConversion: after  'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - GenerateReplacementString: result 'E:\webdav\Kesko\pdf\'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: checking 'E:\webdav\Kesko\pdf\' against pattern '-d'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: cond->SpecialConditionType= 'd'
Thu Mar 12 15:45:15 -  3188 - EvalCondition: Special: it is not a file; not a directory
Thu Mar 12 15:45:15 -  3188 - EvalCondition: Special, retVal= false
Thu Mar 12 15:45:15 -  3188 - EvaluateCondition: Child is NULL
Thu Mar 12 15:45:15 -  3188 - EvalCondition: returning FALSE
Thu Mar 12 15:45:15 -  3188 - EvalConditionList: rule 2, FALSE, Rule does not apply
Thu Mar 12 15:45:15 -  3188 - EvaluateRules: returning 0
Thu Mar 12 15:45:15 -  3188 - DoRewrites: No Rewrite
--