Questions on RewriteMap usage inside IIRF

Topics: Developer Forum, User Forum
Aug 9, 2011 at 11:21 AM

Hi,

I'm starting with IIRF working with IIS and trying to rewrite url's with a .txt map (noticiasmap.txt), the file generated has a structure as follows (as example):

www3.prueba.es/noticia.asp?notid=86002&secid=4 www3.prueba.es/4/Text-on-change

My .ini file:

RewriteLogLevel 1

RewriteLog c:\inetpub\iirfLogs\iirf

RewriteEngine ON

StatusInquiry ON

RewriteMap  noticiasmap   txt:C:\Program Files\Ionic Shade\IIRF 2.1\maps\noticiasmap.txt

RedirectRule (.*) ${noticiasmap:$1}   [R=301]

Web in the IIS is working ok with IIRF (is up) but it doesn't change anything... any help on the problem?

Thanks.

Coordinator
Aug 9, 2011 at 12:20 PM
Edited Aug 9, 2011 at 12:21 PM

yes - here's the problem: the Url mapping does not consider the hostname, but your map file includes the hostname.

your noticiasmap.txt must not include www3.prueba.es , on either argument.

    /noticia.asp?notid=86002&secid=4    /4/Text-on-change

(The URL mapping does include the slash that follows the hostname.)

Also I think maybe your mapping is reversed from what you want.  The first argument is the key, and the second is the associated value. (what the key "maps to").

With the noticiasmap.txt file configured the way you have it,  and using the RewriteRule you have, it says "if the user enters the URL /noticia.asp?notid=86002&secid-4 , then rewrite the url to the internal form which is /4/Text-on-change . I think that seems reversed from the usual case, where the simpler URL is what the user enters, the result of the rewrite (the URL used "internally" by IIS) is the more complicated one . To do that you would need a map file like this:  

    /4/Text-on-change     /noticia.asp?notid=86002&secid=4

If this does not make sense to you, I suggest that you Re-Read the documentation on RewriteMap and check the examples again.

Just to go a little further, I want to remind you that when you map from one item to another using the map lookup, you need not use the entire URL. You can split the URL via the capture subgroups in the regex, the things inside parenthesis, and then do lookups on those capture groups. For example, I notice that there is a 4 in both the key and the value in the single map entry you have. Is it possible this 4 is just a pass-through?  In that case you could build a rule like this:

    RewriteRule /([0-9]+)/([^\?]+)     /noticia.asp?notid=${noticiasmap:$2}&secid=$1

...and then use a map file like this:

    Text-on-change     86002

This can be simpler and clearer for you. What the rule does is capture the segments of the URL into $1 and $2. If the user enters http://www3.prueba.es/4/Text-on-change, then IIRF rewrites that URL, transforming the first segment, which is '4' and is captured into $1, into a query parameter by the name of secid; and it uses the second url segment, which is 'Text-on-change' and is captured into $2, as a lookup key in the map, getting value 86002 and putting that into another query param, named notid. The result of the rewrite is /noticia.asp?notid=86002&secid=4 .

The regular expression pattern, /([0-9]+)/([^\?]+) , says that the first segment must be one or more digits, and the second segment must not have a slash or question mark.

Aug 9, 2011 at 4:15 PM

Hello again,

If i don't consider the hostname, changing it as you say, it doesn't change anything on the result.

Thinking on the situation, the best option would be:

When the user enters the web to the url:

www3.prueba.es/noticia.asp?notid=86002&secid=4

The user must see the web url in the web navigator as follows:

www3.prueba.es/4/Text-on-change

But internally the direction on the IIS must be the original: www3.prueba.es/noticia.asp?notid=86002&secid=4

Making it simple, only a rewriting of the url to the user vision, internally it would work as always but doing changes over the map & ini on the post before I don't understand why it dosen't works for me.¿?

Thanks again for your time & answers. 

Coordinator
Aug 9, 2011 at 5:01 PM
Edited Aug 9, 2011 at 5:01 PM

Yes - well then you need two rules: a redirect and a rewrite.

you have two requirements:

  1. If the user enters the full non-optimized URL, then you need to redirect them to the optimized url (/4/Text-on-change) .
  2. when the user requests the optimized URL (/4/Text-on-change) then you need to internally rewrite the URL so that the original messy URL (/noticia.asp?notid=86002&secid=4) is served.

In all cases it is not necessary to change the hostname. The hostname is irrelevant and need not be considered in the iirf.ini rules.

You can do what you want using the following.

    RewriteMap  noticiasmap   txt:C:\Program Files\Ionic Shade\IIRF 2.1\maps\noticiasmap.txt

    # use Rewrite and Redirect together, to expose SEO URLs
    RedirectRule ^/noticia.asp?notid=([^&]+)&secid=([0-9]+)$ /$1/${noticiasmap:$2}[R=301]
    RewriteRule /([0-9]+)/([^\?]+) /noticia.asp?notid=${noticiasmap:$2}&secid=$1 [L]

The first rule handles the first requirement. The second rule handles the second requirement. 

And in this case, the map file must be like this:

   86002            Text-on-change
   Text-on-change   86002

You must have both entries in the map file because you are doing both forward and reverse mappings.  If you like you could separate those mappings into distinct map files, to make it clearer. 

You may also want to redirect URLs where the order of the query params varies, where secid precedes notid, for example.  I'll leave that for you to figure out.

This technique of pairing the Redirect and Rewrite is covered in the documentation in the "Redirect vs. Rewrite" page.

 

Aug 10, 2011 at 10:08 AM

Hello again,

I'm trying with the info on your last answer and I can see in the log that, in theory, it works perfect but I've one last question, in this part of the log:

Wed Aug 10 10:47:07 -  8860 - EvaluateRules: Rule 1: -1 (No match)

Wed Aug 10 10:47:07 -  8860 - EvaluateRules: Rule 2: pattern: /([0-9]+)/([^\?]+)  subject: /js/rutinas.js

Wed Aug 10 10:47:07 -  8860 - EvaluateRules: Rule 2: -1 (No match)

Wed Aug 10 10:47:07 -  8860 - EvaluateRules: returning 0

Wed Aug 10 10:47:07 -  8860 - DoRewrites: No Rewrite

Wed Aug 10 10:47:07 -  7532 - IsIniChainUpdated: D:\webs\aragondigital3\htdocs\Iirf.ini NO

Wed Aug 10 10:47:07 -  7532 - IsIniChainUpdated: return FALSE

Wed Aug 10 10:47:07 -  7532 - IsIniChainUpdated: C:\Program Files\Ionic Shade\IIRF 2.1\maps\noticiasmap.txt NO

Wed Aug 10 10:47:07 -  7532 - IsIniChainUpdated: return FALSE

Wed Aug 10 10:47:07 -  7532 - IsIniChainUpdated: return FALSE

Wed Aug 10 10:47:07 -  7532 - GetVdirConfig: Obtain  vdir '/LM/W3SVC/120830072/Root' (era=13) (rc=19) (Expired=0) (ptr=0x11233BA0)...

Wed Aug 10 10:47:07 -  7532 - HttpFilterProc: SF_NOTIFY_URL_MAP

Wed Aug 10 10:47:07 -  7532 - HttpFilterProc: cfg= 0x11233BA0

Wed Aug 10 10:47:07 -  7532 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE

Wed Aug 10 10:47:07 -  7532 - DoRewrites

Wed Aug 10 10:47:07 -  7532 - GetHeader_AutoFree: getting 'url'

Wed Aug 10 10:47:07 -  7532 - GetHeader_AutoFree: 19 bytes   ptr:0x0AA41E60

Wed Aug 10 10:47:07 -  7532 - GetHeader_AutoFree: 'url' = '/images/fdM4on.gif'

Wed Aug 10 10:47:07 -  7532 - GetServerVariable_AutoFree: getting 'QUERY_STRING'

Wed Aug 10 10:47:07 -  7532 - GetServerVariable_AutoFree: 1 bytes

Wed Aug 10 10:47:07 -  7532 - GetServerVariable_AutoFree: result ''

Wed Aug 10 10:47:07 -  7532 - GetHeader_AutoFree: getting 'method'

Wed Aug 10 10:47:07 -  7532 - GetHeader_AutoFree: 4 bytes   ptr:0x0A3A7978

Wed Aug 10 10:47:07 -  7532 - GetHeader_AutoFree: 'method' = 'GET'

Wed Aug 10 10:47:07 -  7532 - DoRewrites: New Url, before decoding: '/images/fdM4on.gif'

Wed Aug 10 10:47:07 -  7532 - DoRewrites: Url (decoded): '/images/fdM4on.gif'

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: depth=0

Wed Aug 10 10:47:07 -  7532 - GetServerVariable: getting 'SCRIPT_NAME'

Wed Aug 10 10:47:07 -  7532 - GetServerVariable: 19 bytes

Wed Aug 10 10:47:07 -  7532 - GetServerVariable: result '/images/fdM4on.gif'

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: no RewriteBase

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: Rule 1: pattern: ^/noticia.asp?notid=([^&]+)&secid=([0-9]+)$  subject: /images/fdM4on.gif

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: Rule 1: -1 (No match)

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: Rule 2: pattern: /([0-9]+)/([^\?]+)  subject: /images/fdM4on.gif

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: Rule 2: -1 (No match)

Wed Aug 10 10:47:07 -  7532 - EvaluateRules: returning 0

Wed Aug 10 10:47:07 -  7532 - DoRewrites: No Rewrite

Wed Aug 10 10:47:23 -  5900 - HttpFilterProc: SF_NOTIFY_URL_MAP

Wed Aug 10 10:47:23 -  5900 - HttpFilterProc: cfg= 0x11233BA0

Wed Aug 10 10:47:23 -  5900 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE

Wed Aug 10 10:47:23 -  5900 - DoRewrites

Wed Aug 10 10:47:23 -  5900 - GetServerVariable_AutoFree: getting 'QUERY_STRING'

Wed Aug 10 10:47:23 -  5900 - GetServerVariable_AutoFree: 21 bytes

Wed Aug 10 10:47:23 -  5900 - GetServerVariable_AutoFree: result 'notid=86010&secid=12'

Wed Aug 10 10:47:23 -  5900 - GetHeader_AutoFree: getting 'method'

Wed Aug 10 10:47:23 -  5900 - GetHeader_AutoFree: 4 bytes   ptr:0x0A91B160

Wed Aug 10 10:47:23 -  5900 - GetHeader_AutoFree: 'method' = 'GET'

Wed Aug 10 10:47:23 -  5900 - DoRewrites: New Url, before decoding: '/images/fdM4on.gif?notid=86010&secid=12'

Wed Aug 10 10:47:23 -  5900 - DoRewrites: Url (decoded): '/images/fdM4on.gif?notid=86010&secid=12'

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: depth=0

Wed Aug 10 10:47:23 -  5900 - GetServerVariable: getting 'SCRIPT_NAME'

Wed Aug 10 10:47:23 -  5900 - GetServerVariable: 13 bytes

Wed Aug 10 10:47:23 -  5900 - GetServerVariable: result '/noticia.asp'

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: no RewriteBase

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: Rule 1: pattern: ^/noticia.asp?notid=([^&]+)&secid=([0-9]+)$  subject: /images/fdM4on.gif?notid=86010&secid=12

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: Rule 1: -1 (No match)

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: Rule 2: pattern: /([0-9]+)/([^\?]+)  subject: /images/fdM4on.gif?notid=86010&secid=12

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: Rule 2: -1 (No match)

Wed Aug 10 10:47:23 -  5900 - EvaluateRules: returning 0

Wed Aug 10 10:47:23 -  5900 - DoRewrites: No Rewrite

If I understand correctly this information, it saves, when is receiving & testing url's, the ServerVariable /images/fdM4on.gif (is a different one in every case), and it compares the chain /images/fdM4on.gif?notid=86010&secid=12 when it must be noticia.asp?notid=86010&secid=12.

There is some way to make ServerVariable in that case to be noticia.asp?

Thanks again for your time.

Coordinator
Aug 10, 2011 at 2:48 PM

Yes, it does appear that somehow the incoming URL request is '/images/fdM4on.gif?notid=86010&secid=12' , which looks wrong.

But, it's not clear to me that it is IIRF that is introducing this problem.  You will need to verify the URL that is being sent out of the browser.  To do this you can use any http-aware network trace utility; the one I like is Fiddler2.  It will show you all the requests and responses for HTTP.  You will then be able to see if the browser is in fact requesting '/images/fdM4on.gif?notid=86010&secid=12'.  If it is NOT sending out a request for that URL, then we must look into IIRF for the source of the problem.

 

Aug 10, 2011 at 4:38 PM

Hello,

I think it can be because of the order in which components are loaded, i'm trying to add all the posibilities in the .ini and map files.

In the log i have:

Wed Aug 10 17:31:24 -  2836 - EvaluateRules: Rule 2: pattern: ^/seccion.asp?notid=([^&]+)&secid=([0-9]+)$  subject: /seccion.asp?notid=86010&secid=12

Wed Aug 10 17:31:24 -  2836 - EvaluateRules: Rule 2: -1 (No match)

I think the pattern and the subject matches, isn't the case?

Thanks for your answers.

Coordinator
Aug 11, 2011 at 12:34 AM
Edited Aug 11, 2011 at 12:36 AM

no.

In the pattern, which is a regular expression, the ? is a meaningful character, just as ^ and $ and + are meaningful characters.  Question-mark means "zero or one of the previous atom". In the regex

^/seccion.asp?notid=([^&]+)&secid=([0-9]+)$

...the letter p is the "atom" that precedes the question-mark, so p? in the regex matches either zero or one letter-p.    The entire regex therefore matches these strings:

/seccion.aspnotid=3333&secid=7 
/seccion.asnotid=R&secid=2

Do you see? 

To match a question-mark, you must precede a question-mark in the regex with a backslash. I think you want this:

^/seccion.asp\?notid=([^&]+)&secid=([0-9]+)$

I'm glad to be able to help.

Aug 11, 2011 at 10:08 AM

Yeah, pattern was like that, it matches correctly now, but it seems that it doesn't enter on the noticiasmap map, the new url is written as follows:

http://www3.prueba.es/86010/${noticiasmap:12}[R=301] when it must be http://www3.prueba.es/86010/text-on-change

Iirf.ini is:

RewriteLogLevel 5

RewriteLog c:\temp\iirf5

RewriteEngine ON

StatusInquiry ON

RewriteMap  noticiasmap   txt:C:\Program Files\Ionic Shade\IIRF 2.1\maps\noticiasmap.txt

RedirectRule ^/noticia.asp\?notid=([0-9]+)&secid=([0-9]+)$ /$1/${noticiasmap:$2}[R=301]

RedirectRule ^/seccion.asp\?notid=([^&]+)&secid=([0-9]+)$ /$1/${noticiasmap:$2}[R=301]

RedirectRule ^/includes/ultimahoraCuerpo.asp\?notid=([0-9]+)&secid=([0-9]+)$ /$1/${noticiasmap:$2}[R=301]

RedirectRule ^/images/flechaspqsWhite.gif\?notid=([0-9]+)&secid=([0-9]+)$ /$1/${noticiasmap:$2}[R=301]

RedirectRule ^/includes/cineIframe.asp\?notid=([0-9]+)&secid=([0-9]+)$ /$1/${noticiasmap:$2}[R=301]

RewriteRule /([0-9]+)/([^\?]+) /noticia.asp?notid=${noticiasmap:$2}&secid=$1 [L]

noticiasmap:

86010 text-on-change

text-on-change 86010

I'm trying in doing changes on the RedirectRules but the result is always the same, text-on-change isn't there.

Thanks a lot.

Coordinator
Aug 11, 2011 at 11:30 AM

It's as if the map does not work at all.  did you check the IIRF log?

I am trying to think of reasons why the map would completely not work.  There are two possible reasons I can think of:

  • spaces in the filename for the map file.  I cannot recall now if filenames containing spaces are handled correctly by the RewriteMap directive.
  • Permissions.  are you certain that IUSR and the appropriate IIS groups can read noticiasmap.txt ?  That file must have the same permissions (READ) as IIRF.ini . If IIRF cannot read the file, then the map will not work properly.

Also - regarding the R=301 - you must include a space between the replacement string and [R=301] .   If the result of the redirect shows a [R=301] on the URL itself, it means you are missing the required space in the line in the ini file, before [R=301] . Check all rules.  The rule you have with [L] appears to correctly include a space before the [L] . The rules with [R=xxx] should be similar to that.

 

 

 

Coordinator
Aug 11, 2011 at 11:35 AM

I just checked and spaces in the filenames for mapfiles are handled correctly by the latest IIRF.

So - check the logfile for errors. Also check permissions on the map text file.

you can use /iirfstatus for checking errors. you need a directive like this:

StatusInquiry ON

and then you can go to http://localhost/iirfstatus to get a status report from IIRF.

Check the documentation for more information on that directive.

Aug 11, 2011 at 12:43 PM

Hi again

Adding the ' ' on the .ini only makes the [R301] not to appear on the new URL. http://www3.prueba.es/86010/${noticiasmap:12}

Changing the Direction of the noticiasmap file doesn't make any change on the result, i try in different folders & in the same of .ini too & IUSR has total permissions.

noticiasmap:

86010 text-on-change

text-on-change 86010

The Log xtraction is:

Thu Aug 11 13:38:48 -  9104 - EvaluateRules: Rule 5: pattern: ^/includes/cineIframe.asp\?notid=([0-9]+)&secid=([0-9]+)$  subject: /includes/cineIframe.asp?notid=86010&secid=12

Thu Aug 11 13:38:48 -  9104 - EvaluateRules: Rule 5: 3 matches

Thu Aug 11 13:38:48 -  9104 - ReplaceServerVariables: alloc 22 bytes

Thu Aug 11 13:38:48 -  9104 - ReplaceServerVariables: in='/$2/${noticiasmap:$1}' out='/$2/${noticiasmap:$1}'

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: map?

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: alloc 7 bytes

Thu Aug 11 13:38:48 -  9104 - ApplyUrlEncoding: in '86010'

Thu Aug 11 13:38:48 -  9104 - ApplyUrlEncoding: out '86010'

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: result '86010'

Thu Aug 11 13:38:48 -  9104 - MapKey: map(noticiasmap) key(86010)

Thu Aug 11 13:38:48 -  9104 - MapKey: map(noticiasmap) key(86010) no value found

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: alloc 26 bytes

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: map?

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: alloc 7 bytes

Thu Aug 11 13:38:48 -  9104 - ApplyUrlEncoding: in '86010'

Thu Aug 11 13:38:48 -  9104 - ApplyUrlEncoding: out '86010'

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: result '86010'

Thu Aug 11 13:38:48 -  9104 - MapKey: map(noticiasmap) key(86010)

Thu Aug 11 13:38:48 -  9104 - MapKey: map(noticiasmap) key(86010) no value found

Thu Aug 11 13:38:48 -  9104 - ApplyUrlEncoding: in '/12/${noticiasmap:86010}'

Thu Aug 11 13:38:48 -  9104 - ApplyUrlEncoding: out '/12/${noticiasmap:86010}'

Thu Aug 11 13:38:48 -  9104 - GenerateReplacementString: result '/12/${noticiasmap:86010}'

Thu Aug 11 13:38:48 -  9104 - EvaluateRules: Result (length 24): /12/${noticiasmap:86010}

Seems that it doesn't found the key on the map.

Thanks again.

Coordinator
Aug 11, 2011 at 1:00 PM

yes - check the beginning of the IIRF log - it will show the values it obtains from the map .

This happens only once, at the time IIRF starts up.

You can stop and restart IIS (net stop w3svc, net start w3svc) in order to make IIRF explicitly re-initialize itself.

Then Check the log file to see the values IIRF obtains from the map text file.

 

Aug 11, 2011 at 1:05 PM
Edited Aug 11, 2011 at 1:19 PM

Checked:

Thu Aug 11 13:38:10 -  7480 - ReadVdirConfig: C:\prueba\Iirf.ini(5): RewriteMap   noticiasmap    txt:C:\map\noticiasmap.txt

Thu Aug 11 13:38:10 -  7480 - ReadTextMap: C:\map\noticiasmap.txt(1): key(ÿþ8) value((null))

Solved on this part: file was saved in unicode.

map values on the log:

Thu Aug 11 14:10:11 -  1280 - ReadTextMap: D:\webs\aragondigital3\htdocs\noticiasmap.txt(1): key(86010) value(text-on-change)

Thu Aug 11 14:10:11 -  1280 - ReadTextMap: D:\webs\aragondigital3\htdocs\noticiasmap.txt(2): key(text-on-change) value(86010)

but later, when it does the camparison it doesn't find the key on the map:

Thu Aug 11 14:13:30 -  9104 - EvaluateRules: Rule 5: 3 matches

Thu Aug 11 14:13:30 -  9104 - ReplaceServerVariables: alloc 22 bytes

Thu Aug 11 14:13:30 -  9104 - ReplaceServerVariables: in='/$2/${noticiasmap:$1}' out='/$2/${noticiasmap:$1}'

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: map?

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: alloc 7 bytes

Thu Aug 11 14:13:30 -  9104 - ApplyUrlEncoding: in '86010'

Thu Aug 11 14:13:30 -  9104 - ApplyUrlEncoding: out '86010'

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: result '86010'

Thu Aug 11 14:13:30 -  9104 - MapKey: map(noticiasmap) key(86010)

Thu Aug 11 14:13:30 -  9104 - MapKey: map(noticiasmap) key(86010) no value found

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: alloc 26 bytes

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: map?

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: alloc 7 bytes

Thu Aug 11 14:13:30 -  9104 - ApplyUrlEncoding: in '86010'

Thu Aug 11 14:13:30 -  9104 - ApplyUrlEncoding: out '86010'

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: result '86010'

Thu Aug 11 14:13:30 -  9104 - MapKey: map(noticiasmap) key(86010)

Thu Aug 11 14:13:30 -  9104 - MapKey: map(noticiasmap) key(86010) no value found

Thu Aug 11 14:13:30 -  9104 - ApplyUrlEncoding: in '/12/${noticiasmap:86010}'

Thu Aug 11 14:13:30 -  9104 - ApplyUrlEncoding: out '/12/${noticiasmap:86010}'

Thu Aug 11 14:13:30 -  9104 - GenerateReplacementString: result '/12/${noticiasmap:86010}'

At the beginning it can see "86010" but at the end it doesn't find the key on the map.


Coordinator
Aug 11, 2011 at 2:53 PM

Something is strange.

I don't understand how the map can be not working. I just looked closely at the code and I don't see the problem.

Is it possible that it is something silly - like instead of a zero (0) in the mapfile, you have used a letter-O ? 

I notice that the logs you are sending me are patched together, with pieces cut from multiple different runs.  For me to understand what is happening, it's important to send me a consistent log file - from one IIRF process.

I am going to create a workitem for this diagnosis, and I'll produce a new IIRF dll which emits extra diagnostic information specifically for the mapping. I'd like you to try it and post the log for ONE transaction.  You need to set the loglevel to 6 in your ini file for this (RewriteLogLevel 6).  If possible, instead of putting it in the message, if you could post it to a file sharing URL somewhere, that would make it simpler for me.  I'd like to see the entire log, including the bit at the beginning with the messages associated to startup of IIRF, where it reads the map file.

 

Coordinator
Aug 11, 2011 at 2:53 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Aug 11, 2011 at 2:56 PM

ok, the new DLL is there on the workitem. Try and let me know.

Aug 11, 2011 at 5:02 PM
Edited Aug 11, 2011 at 5:03 PM

Hello,

Solved for the url:

The error was that i work with word & wordpad & in those when the log captures special characters we can't see it, trying with notepad at the beginning of the log when it captures the first key (86010) this number was with a special character at the beginning, becouse of that in the comparison they weren't the same (with a space before the key is solved).

Al this point, i can see the url with the text "text-on-change" but i can't see the web (404), RewriteRule /([0-9]+)/([^\?]+) /noticia.asp?notid=${noticiasmap:$2}&secid=$1 [L] doesn't work, it says EvaluateRules: no RewriteBase on the log.

RewriteRule on the ini:

RewriteRule /([0-9]+)/([^\?]+) /noticia.asp?notid=${noticiasmap:$2}&secid=$1 [L]

Url to work with:

/12/text-on-change

map:

text-on-change 86010

log:

http://www.megaupload.com/?d=TGHVGKJW

Thanks for all.

Coordinator
Aug 11, 2011 at 5:27 PM

Ah good.   I can recommend notepad2 as an excellent, free editor for Windows.

It handles many formats nicely.  http://www.flos-freeware.ch/notepad2.html

I am looking now at your log. Immediately I see problems you should fix:

IirfGlobal.ini(1): WARNING: unrecognized directive, ignoring it: 'RewriteLogLevel'
IirfGlobal.ini(2): WARNING: unrecognized directive, ignoring it: 'RewriteLog' 
IirfGlobal.ini(3): RewriteEngine setting is now: ON			    
IirfGlobal.ini(4): StatusInquiry setting is now: ON			    
IirfGlobal.ini(5): WARNING: unrecognized directive, ignoring it: 'RewriteMap' 
IirfGlobal.ini(7): WARNING: unrecognized directive, ignoring it: 'RedirectRule'
IirfGlobal.ini(8): WARNING: unrecognized directive, ignoring it: 'RewriteRule'

Start by Fixing those 5 warnings.

The "No RewriteBase" message is informational.  It does not indicate an error or problem.

Looking at the rest of your rules, I'm not clear on why you are doing the things you are doing.  You have rules that match GIF URLs that carry query strings.  It's very unusual to have a gif URL that is parameterized with query strings - are you sure you need that or want that?  I think maybe you don't.   I am talking about this rule:

RedirectRule ^/images/flechaspqsWhite.gif\?notid=([0-9]+)&secid=([0-9]+)$   /$2/${noticiasmap:$1}  [R=301]

Unless flechaspqsWhite.gif maps to a program that dynamically generates GIF files, I think this rule is .... wrong.   This suggests a poor understanding on your part of exactly what is happening inside IIRF, and what the rules do. I suggest you spend some time reading the IIRF documentation to understand better what you can do with the filter, and how it is best used. 

In the IIRF log,  I don't see any incoming requests like /4/text-on-change .   I see some incoming requests like /?secid=12. and /?notid=86010&secid=12  .  But you have no rules covering those URLs.  Where are these requests coming from?  You haven't mentioned an expectation that incoming requests would look like that, and you have no rules that match them. 

I think you need to take a step back, take some time, and read the documentation. There's lots of good information there.  You need to improve your base understanding of URL rewriting, I think.  And also basic IIRF operation.

I am answering too many basic questions here;  these are issues that are clearly explained in the documentation.  Rather than asking me to answer them here just for you, read the documentation and you will gain some understanding.  I know it's no fun to read technical documentation, but it's even less fun for me to rewrite the documentation here in responses to questions.   Also try out the Fiddler2 tool - it will let you see which URL requests get sent by your browser, and when.  It will show the responses you get from the server.  It's very helpful in expanding your understanding.

Good luck.