please help me..DokuWIki rewrite not work

Mar 7, 2010 at 6:27 AM
Edited Mar 7, 2010 at 6:30 AM

My OS is windows xp sp3 and IIS version is 5.1
I success to install ionics isapi rewrite.
and I create a IIRF.ini file in my DokuWiki site root, then use http://localhost/DokuWiki/iirfStatus to test it and it works.

then I follow this topic http://www.dokuwiki.org/rewrite
paste the Ionics Isapi Rewrite Filter rules into the IIRF.init file then test it by requesting http://localhost/DokuWiki/123, but I got the "page not found" error.
I checked logs, but cant find out where the problem is
Please help me...I had tried many days, thanks.

this pic shows Ionics isapi rewrite works normally.
http://farm5.static.flickr.com/4063/4413057214_f2376b304a_b.jpg


=======================================================

here's my DokuWIki IIRF.init file content:
StatusUrl /iirfStatus
RewriteLogLevel 5
RewriteLog \logs\iirf

IterationLimit 1
 
# QSA is not supported, fix it
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule (.*)\?(.*) $1&$2
 
RewriteRule ^/_media/(.*)             /lib/exe/fetch.php?media=$1   [QSA,L]
RewriteRule ^/_detail/(.*)            /lib/exe/detail.php?media=$1  [QSA,L]
RewriteRule ^/_export/([^/]+)/(.*)    /doku.php?do=export_$1&id=$2  [QSA,L]
RewriteRule ^/$                       /doku.php                     [QSA,L]
# infinite redirect fix
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule ^/(.*)/$                  /doku.php?id=$1               [QSA,L]
# end fix
RewriteCond %{REQUEST_FILENAME}       !-f
RewriteCond %{REQUEST_FILENAME}       !-d
RewriteRule ^/(.*)                    /doku.php?id=$1               [QSA,L]

=======================================================

here's the log of my DokuWiki site:
[quote]Sun Mar 07 15:23:09 -   464 - -------------------------------------------------------
Sun Mar 07 15:23:09 -   464 - Ionic ISAPI Rewriting Filter (IIRF) 2.0.1.15 RELEASE
Sun Mar 07 15:23:09 -   464 - IIRF was built on: Dec  3 2009 11:49:15
Sun Mar 07 15:23:09 -   464 - Cached: DLL_PROCESS_ATTACH
Sun Mar 07 15:23:09 -   464 - Cached: Process ID: 5764
Sun Mar 07 15:23:09 -   464 - Cached: DLL_PROCESS_ATTACH - complete
Sun Mar 07 15:23:09 -   464 - Cached: GetFilterVersion
Sun Mar 07 15:23:09 -   464 - Cached: DLL_THREAD_DETACH
Sun Mar 07 15:23:09 -   464 - Cached: DLL_THREAD_DETACH
Sun Mar 07 15:23:09 -   464 - Cached: DLL_THREAD_DETACH
Sun Mar 07 15:23:09 -   464 - Cached: DLL_THREAD_DETACH
Sun Mar 07 15:23:09 -   464 - GetLogFile: app:'/LM/W3SVC/1/Root/DokuWiki'  new log:'D:\Web\dokuwiki\logs\iirf.5764.log'
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: actual log file 'D:\Web\dokuwiki\logs\iirf.5764.log'
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: ini file: 'D:\Web\dokuwiki\Iirf.ini'
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: ini file timestamp: 2010/03/07 13:52:28 (local time)
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: pass 1
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line   1: StatusUrl /iirfStatus
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line   1: StatusUrl is enabled for local requests only.
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line   5: IterationLimit 1
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line   8: RewriteCond   %{REQUEST_FILENAME}  !-f
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line   9: RewriteCond   %{REQUEST_FILENAME}  !-d
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  10: RewriteRule (rule 1)  '(.*)\?(.*)'  '$1&$2'   (null)
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  12: RewriteRule (rule 2)  '^/_media/(.*)'  '/lib/exe/fetch.php?media=$1'  [QSA,L]
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: '[QSA,L]'
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'QSA'
Sun Mar 07 15:23:09 -   464 - rule: Querystring Append
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'L'
Sun Mar 07 15:23:09 -   464 - rule: Last
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  13: RewriteRule (rule 3)  '^/_detail/(.*)'  '/lib/exe/detail.php?media=$1'  [QSA,L]
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: '[QSA,L]'
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'QSA'
Sun Mar 07 15:23:09 -   464 - rule: Querystring Append
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'L'
Sun Mar 07 15:23:09 -   464 - rule: Last
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  14: RewriteRule (rule 4)  '^/_export/([^/]+)/(.*)'  '/doku.php?do=export_$1&id=$2'  [QSA,L]
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: '[QSA,L]'
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'QSA'
Sun Mar 07 15:23:09 -   464 - rule: Querystring Append
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'L'
Sun Mar 07 15:23:09 -   464 - rule: Last
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  15: RewriteRule (rule 5)  '^/$'  '/doku.php'  [QSA,L]
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: '[QSA,L]'
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'QSA'
Sun Mar 07 15:23:09 -   464 - rule: Querystring Append
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'L'
Sun Mar 07 15:23:09 -   464 - rule: Last
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  17: RewriteCond   %{REQUEST_FILENAME}  !-d
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  18: RewriteRule (rule 6)  '^/(.*)/$'  '/doku.php?id=$1'  [QSA,L]
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: '[QSA,L]'
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'QSA'
Sun Mar 07 15:23:09 -   464 - rule: Querystring Append
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'L'
Sun Mar 07 15:23:09 -   464 - rule: Last
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  20: RewriteCond   %{REQUEST_FILENAME}  !-f
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  21: RewriteCond   %{REQUEST_FILENAME}  !-d
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: line  22: RewriteRule (rule 7)  '^/(.*)'  '/doku.php?id=$1'  [QSA,L]
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: not a duplicate rule...
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: '[QSA,L]'
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'QSA'
Sun Mar 07 15:23:09 -   464 - rule: Querystring Append
Sun Mar 07 15:23:09 -   464 - ParseRuleModifierFlags: token 'L'
Sun Mar 07 15:23:09 -   464 - rule: Last
Sun Mar 07 15:23:09 -   464 - ReadSiteConfig: Done reading, found 7 rules (0 errors, 0 warnings) on 23 lines
Sun Mar 07 15:23:09 -   464 - GetSiteConfig: Obtain  site '/LM/W3SVC/1/Root/DokuWiki' (era=0) (rc=1) (Expired=0) (ptr=0x01AB54E8)...
Sun Mar 07 15:23:09 -   464 - HttpFilterProc: SF_NOTIFY_URL_MAP
Sun Mar 07 15:23:09 -   464 - HttpFilterProc: cfg= 0x01AB54E8
Sun Mar 07 15:23:09 -   464 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Sun Mar 07 15:23:09 -   464 - DoRewrites
Sun Mar 07 15:23:09 -   464 - GetServerVariable_AutoFree: getting 'url'
Sun Mar 07 15:23:09 -   464 - GetServerVariable_AutoFree: 128 bytes
Sun Mar 07 15:23:09 -   464 - GetServerVariable_AutoFree: result ''
Sun Mar 07 15:23:09 -   464 - GetHeader_AutoFree: getting 'url'
Sun Mar 07 15:23:09 -   464 - GetHeader_AutoFree: 21 bytes   ptr:0x0011ED58
Sun Mar 07 15:23:09 -   464 - GetHeader_AutoFree: 'url' = '/DokuWiki/iirfStatus'
Sun Mar 07 15:23:09 -   464 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Sun Mar 07 15:23:09 -   464 - GetServerVariable_AutoFree: 1 bytes
Sun Mar 07 15:23:09 -   464 - GetServerVariable_AutoFree: result ''
Sun Mar 07 15:23:09 -   464 - GetHeader_AutoFree: getting 'method'
Sun Mar 07 15:23:09 -   464 - GetHeader_AutoFree: 4 bytes   ptr:0x0011EE68
Sun Mar 07 15:23:09 -   464 - GetHeader_AutoFree: 'method' = 'GET'
Sun Mar 07 15:23:09 -   464 - DoRewrites: New Url, before decoding: '/DokuWiki/iirfStatus'
Sun Mar 07 15:23:09 -   464 - DoRewrites: Url (no decoding): '/DokuWiki/iirfStatus'
Sun Mar 07 15:23:09 -   464 - EvaluateRules: depth=0
Sun Mar 07 15:23:09 -   464 - GetServerVariable: getting 'REMOTE_ADDR'
Sun Mar 07 15:23:09 -   464 - GetServerVariable: 10 bytes
Sun Mar 07 15:23:09 -   464 - GetServerVariable: result '127.0.0.1'
Sun Mar 07 15:23:09 -   464 - GetServerVariable: getting 'LOCAL_ADDR'
Sun Mar 07 15:23:09 -   464 - GetServerVariable: 10 bytes
Sun Mar 07 15:23:09 -   464 - GetServerVariable: result '127.0.0.1'
Sun Mar 07 15:23:09 -   464 - HttpFilterProc: SF_NOTIFY_LOG
Sun Mar 07 15:23:09 -   464 - ReleaseOrExpireSiteConfig: site '/LM/W3SVC/1/Root/DokuWiki' (era=0) (rc=0) (Expired=0) (ptr=0x01AB54E8)...
Sun Mar 07 15:23:16 -   248 - IsIniFileUpdated: D:\Web\dokuwiki\Iirf.ini NO
Sun Mar 07 15:23:16 -   248 - GetSiteConfig: Obtain  site '/LM/W3SVC/1/Root/DokuWiki' (era=0) (rc=1) (Expired=0) (ptr=0x01AB54E8)...
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: SF_NOTIFY_URL_MAP
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: cfg= 0x01AB54E8
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Sun Mar 07 15:23:16 -   248 - DoRewrites
Sun Mar 07 15:23:16 -   248 - GetServerVariable_AutoFree: getting 'url'
Sun Mar 07 15:23:16 -   248 - GetServerVariable_AutoFree: 128 bytes
Sun Mar 07 15:23:16 -   248 - GetServerVariable_AutoFree: result ''
Sun Mar 07 15:23:16 -   248 - GetHeader_AutoFree: getting 'url'
Sun Mar 07 15:23:16 -   248 - GetHeader_AutoFree: 14 bytes   ptr:0x0011ED58
Sun Mar 07 15:23:16 -   248 - GetHeader_AutoFree: 'url' = '/DokuWiki/123'
Sun Mar 07 15:23:16 -   248 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Sun Mar 07 15:23:16 -   248 - GetServerVariable_AutoFree: 1 bytes
Sun Mar 07 15:23:16 -   248 - GetServerVariable_AutoFree: result ''
Sun Mar 07 15:23:16 -   248 - GetHeader_AutoFree: getting 'method'
Sun Mar 07 15:23:16 -   248 - GetHeader_AutoFree: 4 bytes   ptr:0x0011EE68
Sun Mar 07 15:23:16 -   248 - GetHeader_AutoFree: 'method' = 'GET'
Sun Mar 07 15:23:16 -   248 - DoRewrites: New Url, before decoding: '/DokuWiki/123'
Sun Mar 07 15:23:16 -   248 - DoRewrites: Url (no decoding): '/DokuWiki/123'
Sun Mar 07 15:23:16 -   248 - EvaluateRules: depth=0
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 1 : -1 (No match)
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 2 : -1 (No match)
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 3 : -1 (No match)
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 4 : -1 (No match)
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 5 : -1 (No match)
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 6 : -1 (No match)
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Rule 7 : 2 matches
Sun Mar 07 15:23:16 -   248 - GetServerVariable: getting 'REQUEST_FILENAME'
Sun Mar 07 15:23:16 -   248 - GetServerVariable: special variable name
Sun Mar 07 15:23:16 -   248 - GetServerVariable: 19 bytes
Sun Mar 07 15:23:16 -   248 - GetServerVariable: result 'D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - ReplaceServerVariables: in='%{REQUEST_FILENAME}' out='D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - EvalCondition: ts1 'D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - GenerateReplacementString: result 'D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - EvalCondition: checking 'D:\Web\dokuwiki\123' against pattern '!-f'
Sun Mar 07 15:23:16 -   248 - EvalCondition: cond->SpecialConditionType= 'f'
Sun Mar 07 15:23:16 -   248 - EvalCondition: Special: it is not a file
Sun Mar 07 15:23:16 -   248 - EvalCondition: Special, retVal= false
Sun Mar 07 15:23:16 -   248 - EvalCondition: Cond %{REQUEST_FILENAME} !-f => TRUE
Sun Mar 07 15:23:16 -   248 - EvalCondition: Child is non NULL (parent= 0x01AB8430) (child= 0x01AB8480)
Sun Mar 07 15:23:16 -   248 - EvalCondition: Current condition evaluates to TRUE
Sun Mar 07 15:23:16 -   248 - EvalCondition: Logical AND, ergo we evaluate the Child
Sun Mar 07 15:23:16 -   248 - GetServerVariable: getting 'REQUEST_FILENAME'
Sun Mar 07 15:23:16 -   248 - GetServerVariable: special variable name
Sun Mar 07 15:23:16 -   248 - GetServerVariable: 19 bytes
Sun Mar 07 15:23:16 -   248 - GetServerVariable: result 'D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - ReplaceServerVariables: in='%{REQUEST_FILENAME}' out='D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - EvalCondition: ts1 'D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - GenerateReplacementString: result 'D:\Web\dokuwiki\123'
Sun Mar 07 15:23:16 -   248 - EvalCondition: checking 'D:\Web\dokuwiki\123' against pattern '!-d'
Sun Mar 07 15:23:16 -   248 - EvalCondition: cond->SpecialConditionType= 'd'
Sun Mar 07 15:23:16 -   248 - EvalCondition: Special: it is not a directory
Sun Mar 07 15:23:16 -   248 - EvalCondition: Special, retVal= false
Sun Mar 07 15:23:16 -   248 - EvalCondition: Cond %{REQUEST_FILENAME} !-d => TRUE
Sun Mar 07 15:23:16 -   248 - EvalConditionList: rule 7, TRUE, Rule will apply
Sun Mar 07 15:23:16 -   248 - ReplaceServerVariables: in='/doku.php?id=$1' out='/doku.php?id=$1'
Sun Mar 07 15:23:16 -   248 - GenerateReplacementString: result '/doku.php?id=DokuWiki/123'
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Result (length 25): /doku.php?id=DokuWiki/123
Sun Mar 07 15:23:16 -   248 - GetServerVariable: getting 'QUERY_STRING'
Sun Mar 07 15:23:16 -   248 - GetServerVariable: 1 bytes
Sun Mar 07 15:23:16 -   248 - GetServerVariable: result ''
Sun Mar 07 15:23:16 -   248 - EvaluateRules: Last Rule
Sun Mar 07 15:23:16 -   248 - EvaluateRules: returning 1
Sun Mar 07 15:23:16 -   248 - DoRewrites: Rewrite Url to: '/doku.php?id=DokuWiki/123'
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: SF_NOTIFY_URL_MAP
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: cfg= 0x01AB54E8
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: SF_NOTIFY_URL_MAP
Sun Mar 07 15:23:16 -   248 - HttpFilterProc: cfg= 0x01AB54E8
Sun Mar 07 15:23:16 -  5652 - HttpFilterProc: SF_NOTIFY_LOG
Sun Mar 07 15:23:16 -  5652 - ReleaseOrExpireSiteConfig: site '/LM/W3SVC/1/Root/DokuWiki' (era=0) (rc=0) (Expired=0) (ptr=0x01AB54E8)...

Coordinator
Mar 8, 2010 at 10:22 PM

Hello!

The FINAL rule in your ini file is firing on the incoming URL (http://localhost/DokuWiki/123) and the URL is being rewritten to '/doku.php?id=DokuWiki/123'   Is that what you expect?

You said you are getting a 404.  What if you key in this address directly into the browser address bar:  http://localhost/doku.php?id=DokuWiki/123  

What happens?  If you get a 404, that means there's nothing at that URL.  Do you expect that there should be something there?

-Cheeso

 

 

Mar 9, 2010 at 4:40 AM
Cheeso wrote:

Hello!

The FINAL rule in your ini file is firing on the incoming URL (http://localhost/DokuWiki/123) and the URL is being rewritten to '/doku.php?id=DokuWiki/123'   Is that what you expect?

You said you are getting a 404.  What if you key in this address directly into the browser address bar:  http://localhost/doku.php?id=DokuWiki/123  

What happens?  If you get a 404, that means there's nothing at that URL.  Do you expect that there should be something there?

-Cheeso

 

 

Sorry not described clearly.

My problem is when I request http://123.204.86.75/DokuWiki/123, I want it to be rewrited as http://123.204.86.75/DokuWiki/doku.php?id=123

But I got the 404 error.

Key in this address http://123.204.86.75/DokuWiki/doku.php?id=123 directly is OK.

thanks you.

 

 

 

 

Coordinator
Mar 9, 2010 at 9:49 PM

After this line in your ini file:

RewriteRule ^/$                       /doku.php                     [QSA,L]

Insert another one line this:

RewriteRule ^/DokuWiki/([0-9]+)$      /DokuWiki/doku.php?id=$1      [L]

That will fix it.

Also, you didn't ask, but...Based on your description, I think you probably want to fix the prior rule, also. This rule:

RewriteRule ^/$                       /doku.php                     [QSA,L]

...seems likely to be wrong. If your URL path is rooted at /DokuWiki, then you should have /DokuWiki/doku.php as the rewrite target. I think.

In any case you should test a large set of URLs against your rules. See the documentation on the TestDriver program for some hints on that.

Good luck