ionic installed but still getting page not found

Topics: User Forum
Jan 31, 2011 at 4:08 PM

Hi, 

I have installed the ionic tool on my vista computer iis7. it has been installed correctly i check as it shows in the localhost/iirfStatus. But i have created 

sample aspx.net website which when clicked on the button gets you to the landingpage.aspx?cid=45. I have written a rewrite rule the iifr.ini file as follows

StatusUrl /iirfStatus RemoteOk

RewriteEngine ON

RewriteLog c:/temp/iirf/

RewriteRule ^/landingpage/([0-9]*)/? /landingpage.aspx?cid=$1  [QSA]

It is not rewrting the url into http://localhost/landingpage/45 

 

I appreciate your help!

Thanks,

sandesh

Jan 31, 2011 at 4:12 PM

srry i miss-typed the file name iirf.ini 

Coordinator
Feb 2, 2011 at 2:28 PM

ok - first, some corrections.  Modify the line for RewriteLog in the ini file to be

RewriteLog c:/temp/iirf

(no trailing slash) and Add

RewriteLogLevel 3 into your iirf.ini file, just for testing.

Also - your description makes it seem that you are not clear on how URL rewriting works.  You might want to review the page in the documentation entitled "Rewriting versus Redirecting" (or something similar).  It gives a good overview of rewriting, how it works.

You said you have a button that when clicked gets the user to /landingpage.aspx?cid=45 .  Fine.  Then in your IIRF.ini file you have a rule that rewrites from /landingpage/45 to /landingpage.aspx?cid=45 .  Ok.

You then said that your rule is not working the way you expect.  How did you test it?  What URL did you request, and what results did you see?  What exactly do you mean by "It is not rewrting the url into http://localhost/landingpage/45"

After making one request, What is in the iirf log file?  The IIRF log file will be created properly inly if you make the changes I described above.

 

Feb 2, 2011 at 8:32 PM

Thanks for the reply!

I guess i might not be understanding  the rewrite concept  well.

I have two pages one as landingpage.aspx and the second as default.aspx. Now there is a button on the default.aspx which has

a response.redirect(landingpage/45);

What i m assuming is that  when the user clicks on the button,  in the address bar it shows http://localhost/landingpage/45 and displays the content

of the page(landingpage.aspx?cid=45) as if it is called. But now when i run it , it shows the that there is a server error in the folder which contains the

.aspx files "The resource cannot be found". I used the Test driver to check the url rule, it says 

CrackUrl: /landingpage/45. (len:16) crackUrl: failed. (error=0*00002ee6)CrackUrl: http://www.example.com/landing/45/. (len:38)

REWRITE ' /landingpage/45/' ==> 'landingpage.aspx?cid=45'

OK

-----------------------------------------

-->the contents of the SampleUrls.txt :                                   

/landingpage/45/           landingpage.aspx?cid=45

-->contents of Iirf.ini :

RewriteEngine ON
StatusUrl /iirfStatus
RewriteLogLevel 3
RewriteLog c:/temp/iirf
RewriteRule ^/landingpage/([0-9]*)/?  landingpage.aspx?cid=$1  [QSA]

 

below is the content of the log file

Wed Feb 02 14:20:08 -  5260 - -------------------------------------------------------
Wed Feb 02 14:20:08 -  5260 - Ionic ISAPI Rewriting Filter (IIRF) 2.0.1.15 RELEASE
Wed Feb 02 14:20:08 -  5260 - IIRF was built on: Dec  3 2009 11:49:15
Wed Feb 02 14:20:08 -  5260 - GetLogFile: app:'/LM/W3SVC/1/ROOT'  new log:'c:\temp\iirf.3956.log'
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: actual log file 'c:\temp\iirf.3956.log'
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: ini file: 'C:\inetpub\wwwroot\Iirf.ini'
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: ini file timestamp: 2011/02/02 13:23:03 Central Standard Time
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: line   2: StatusUrl /iirfStatus
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: line   2: StatusUrl is enabled for local requests only.
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: line   5: RewriteRule (rule 1)  '^/landingpage/([0-9]*)/?'  'landingpage.aspx?cid=$1'    [QSA]
Wed Feb 02 14:20:08 -  5260 - ReadSiteConfig: Done reading, found 1 rules (0 errors, 0 warnings) on 7 lines
Wed Feb 02 14:20:08 -  5260 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 02 14:20:08 -  5260 - HttpFilterProc: cfg= 0x02412C60
Wed Feb 02 14:20:08 -  5260 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 02 14:20:08 -  5260 - DoRewrites
Wed Feb 02 14:20:08 -  5260 - DoRewrites: Url (no decoding): '/iirfStatus'
Wed Feb 02 14:20:08 -  5260 - EvaluateRules: depth=0
Wed Feb 02 14:20:08 -  5260 - HttpFilterProc: SF_NOTIFY_LOG
Wed Feb 02 14:20:14 -  5260 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 02 14:20:14 -  5260 - HttpFilterProc: cfg= 0x02412C60
Wed Feb 02 14:20:14 -  5260 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 02 14:20:14 -  5260 - DoRewrites
Wed Feb 02 14:20:14 -  5260 - DoRewrites: Url (no decoding): '/iirfStatus'
Wed Feb 02 14:20:14 -  5260 - EvaluateRules: depth=0
Wed Feb 02 14:20:14 -  5260 - HttpFilterProc: SF_NOTIFY_LOG
Wed Feb 02 14:20:15 -  5260 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 02 14:20:15 -  5260 - HttpFilterProc: cfg= 0x02412C60
Wed Feb 02 14:20:15 -  5260 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 02 14:20:15 -  5260 - DoRewrites
Wed Feb 02 14:20:15 -  5260 - DoRewrites: Url (no decoding): '/iirfStatus'
Wed Feb 02 14:20:15 -  5260 - EvaluateRules: depth=0
Wed Feb 02 14:20:15 -  5260 - HttpFilterProc: SF_NOTIFY_LOG

 

thanks,

sandesh

 

Coordinator
Feb 2, 2011 at 9:26 PM

I think you understand rewriting just fine.

Looking at your log file, I don't see any indication that the request for /landingpage/45 was ever received by IIRF.

Not sure why that would happen. But if IIRF does not receive the request, IIRF cannot rewrite it.

Do you have a vdir called "/landingpage" ?  If so, then that would explain why your IIRF install is not seeing the request.

Feb 3, 2011 at 3:19 PM

Thanks for your reply!

no, i don't have any folder called /landingpage. The  iirf.ini file is in " C:\Inetpub\wwwroot\ " and the " iirf.dll is in c:\iirf\ "

since these two files are in different folder is that what might be affecting the IIRF(not able to read)? If IIRF were to recieve the

request for /landingpage/45 how would it look like in the log?

 

Thanks,

sandesh.

Coordinator
Feb 5, 2011 at 3:03 AM

For every URL received by the filter, there is a sequence like:

Wed Feb 02 14:20:14 -  5260 - DoRewrites
Wed Feb 02 14:20:14 -  5260 - DoRewrites: Url (no decoding): '/iirfStatus'

...in the log file.  The incoming URL is shown on the second line there.  In this case it is the status inquiry URL, "/iirfstatus".  If you were to request /landingpage/45, it would show up there.

The fact that your IIRF.dll is in a different place than wwwroot is not relevant.  This is the recommended way to do things.  In a prior version of IIRf, it was necessary to put the ini file in the same directory as the DLL.  But that has not been the case for several years now, since the release of v2.


I'm trying to think of reasons why your IIS would not see the incoming request.  One possible reason is if you have a vdir named /landingpage, then your root vdir would not "see" the request and IIRF would never have the change to rewrite it.  You said that is not the case with you.  Another possible reason: If you have another filter installed, like a URL scanner, it could suppress the URL, in which case IIRF would never see it.  I'll try to think of other reasons, but so far that's all I can think of.

To track this down you might look at the IIS log.   It would indicate the incoming request, if it was received at all, regardless of the site or vdir that handled the request.  In the IIS log you would see the response code, and it may give you some insight into how the /landingpage/45 request is being handled.  If you see no request for that URL in the IIS log, then I don't know what to tell you.  That would indicate that IIS is never seeing the request, which of course means IIRF is not seeing the request.  But I don't have good suggestions for fixing or diagnosing that.

 

 

 

Feb 8, 2011 at 12:46 AM

Thanks for the reply!

I am not sure about the URL scanner, could you tell me , where can it be seen, if it were to be in my system.

I searched landingpage in iis 7 log and this is wat i found...

2011-02-08 00:22:55 127.0.0.1 GET /testurlrewrite/urlrewrite/landingpage/45 - 80 - 127.0.0.1 Mozilla/5.0+(Windows;+U;+Windows+NT+6.0;+en-US;+rv:1.9.2.13)+Gecko/20101203+Firefox/3.6.13+(+.NET+CLR+3.5.30729;+.NET4.0C) 404 0 2 13

 there is no DoRewrite mentioned in the log.

 

Thanks,

Sandesh

 

Feb 9, 2011 at 4:52 AM

Hi,

I tried to get it work on my laptop using documentation and your  suggestions from above, but is not working . Then i installed it on another computer , vista. and i checked the log,  it seems like the iirf is recieving the request, which is great. but, it does not rewrite the url. in here i have a link called feedbacks, when clicked it shows the data of feedback.aspx.

This is wat the log file says:

Tue Feb 08 16:33:39 -  1464 - DoRewrites: Url (no decoding): '/iirfStatus'
Tue Feb 08 16:33:39 -  1464 - EvaluateRules: depth=0
Tue Feb 08 16:33:39 -  1464 - HttpFilterProc: SF_NOTIFY_LOG
Tue Feb 08 16:33:40 -  1464 - HttpFilterProc: SF_NOTIFY_URL_MAP
Tue Feb 08 16:33:40 -  1464 - HttpFilterProc: cfg= 0x019570C8
Tue Feb 08 16:33:40 -  1464 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Tue Feb 08 16:33:40 -  1464 - DoRewrites
Tue Feb 08 16:33:40 -  1464 - DoRewrites: Url (no decoding): '/favicon.ico'
Tue Feb 08 16:33:40 -  1464 - EvaluateRules: depth=0
Tue Feb 08 16:33:40 -  1464 - EvaluateRules: Rule 1 : -1 (No match)
Tue Feb 08 16:33:40 -  1464 - EvaluateRules: Rule 2 : -1 (No match)
Tue Feb 08 16:33:40 -  1464 - EvaluateRules: returning 0
Tue Feb 08 16:33:40 -  1464 - DoRewrites: No Rewrite
Tue Feb 08 16:33:40 -  2580 - HttpFilterProc: SF_NOTIFY_LOG
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: actual log file 'c:\inetpub\wwwroot\on.2188.

log'
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: ini file: 'c:\inetpub\wwwroot\Iirf.ini'
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: ini file timestamp: 2011/02/08 16:51:13 (local time)
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   5: LogLevel = 3
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   1: StatusUrl /IirfStatus
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   1: StatusUrl is enabled for local requests only.
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: WARNING: line 3: unrecognized directive, ignoring it: 'RewriteFilterPriority'
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   6: RewriteRule (rule 1)  '^/landingpage/([0-9]*)/?'  '/landingpage.aspx?cid=$1'   (null)
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   7: RewriteRule (rule 2)  '^/feedbacks'  '/feedback.aspx'   (null)
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: Done reading, found 2 rules (0 errors, 1 warnings) on 8 lines
Thanks,
sandesh
Feb 9, 2011 at 5:20 PM

Hi,

Sorry for too many messages.

I tried a redirect rule RedirectRule ^/(.*)$  http://yahoo.com  [R=301]

so when i use http://localhost on the url it got redirected to yahoo.com

but then when i try to use RewriteRule  ^/feedbacks  /feedback.aspx its not working

and also the aspx code is under E:\httpdocs does this name of the folder needs to be mentioned in the rewrite rule?

'c:\inetpub\wwwroot\on.2188.log'
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: ini file: 'c:\inetpub\wwwroot\Iirf.ini'
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: ini file timestamp: 2011/02/09 11:01:10 (local time)
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: line   4: LogLevel = 3
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: line   1: StatusUrl /IirfStatus
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: line   1: StatusUrl is enabled for local requests only.
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: line   5: RewriteRule (rule 1)  '^/httpdocs/feedbacks'  '/feedback.aspx'   (null)
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: line   6: RedirectRule (rule 2)  '^/(.*)$'  'http://yahoo.com'  [R=301]
Wed Feb 09 11:01:33 -  3156 - ReadSiteConfig: Done reading, found 2 rules (0 errors, 0 warnings) on 11 lines
Wed Feb 09 11:01:33 -  3156 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 09 11:01:33 -  3156 - HttpFilterProc: cfg= 0x01954238
Wed Feb 09 11:01:33 -  3156 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 09 11:01:33 -  3156 - DoRewrites
Wed Feb 09 11:01:33 -  3156 - DoRewrites: Url (no decoding): '/iirfStatus'
Wed Feb 09 11:01:33 -  3156 - EvaluateRules: depth=0
Wed Feb 09 11:01:33 -  3156 - HttpFilterProc: SF_NOTIFY_LOG
Wed Feb 09 11:01:34 -  3156 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 09 11:01:34 -  3156 - HttpFilterProc: cfg= 0x01954238
Wed Feb 09 11:01:34 -  3156 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 09 11:01:34 -  3156 - DoRewrites
Wed Feb 09 11:01:34 -  3156 - DoRewrites: Url (no decoding): '/iirfStatus'
Wed Feb 09 11:01:34 -  3156 - EvaluateRules: depth=0
Wed Feb 09 11:01:34 -  3156 - HttpFilterProc: SF_NOTIFY_LOG
Wed Feb 09 11:07:40 -  3156 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 09 11:07:40 -  3156 - HttpFilterProc: cfg= 0x01954238
Wed Feb 09 11:07:40 -  3156 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 09 11:07:40 -  3156 - DoRewrites
Wed Feb 09 11:07:40 -  3156 - DoRewrites: Url (no decoding): '/iirfStatus'
Wed Feb 09 11:07:40 -  3156 - EvaluateRules: depth=0
Wed Feb 09 11:07:40 -  3156 - HttpFilterProc: SF_NOTIFY_LOG
Wed Feb 09 11:07:46 -  3156 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Feb 09 11:07:46 -  3156 - HttpFilterProc: cfg= 0x01954238
Wed Feb 09 11:07:46 -  3156 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Feb 09 11:07:46 -  3156 - DoRewrites
Wed Feb 09 11:07:46 -  3156 - DoRewrites: Url (no decoding): '/'
Wed Feb 09 11:07:46 -  3156 - EvaluateRules: depth=0
Wed Feb 09 11:07:46 -  3156 - EvaluateRules: Rule 1 : -1 (No match)
Wed Feb 09 11:07:46 -  3156 - EvaluateRules: Rule 2 : 2 matches
Wed Feb 09 11:07:46 -  3156 - EvaluateRules: Result (length 16): http://yahoo.com
Wed Feb 09 11:07:46 -  3156 - EvaluateRules: returning 1301
Wed Feb 09 11:07:46 -  3156 - DoRewrites: Redirect (code=301) Url to: 'http://yahoo.com'

 

Appreciate your help!

Thanks,

sandesh

Coordinator
Feb 10, 2011 at 3:03 PM

Sandesh, regarding your previous message...

You have a directive "RewriteFilterPriority" which is present in the IIRF.ini file, and should not be there. you can clearly see the warning about this in the IIRF log file you posted.

Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: ini file: 'c:\inetpub\wwwroot\Iirf.ini'
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: ini file timestamp: 2011/02/08 16:51:13 (local time)
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   5: LogLevel = 3
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   1: StatusUrl /IirfStatus
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   1: StatusUrl is enabled for local requests only.
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: WARNING: line 3: unrecognized directive, ignoring it: 'RewriteFilterPriority'
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   6: RewriteRule (rule 1)  '^/landingpage/([0-9]*)/?'  '/landingpage.aspx?cid=$1'   (null)
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: line   7: RewriteRule (rule 2)  '^/feedbacks'  '/feedback.aspx'   (null)
Tue Feb 08 16:52:08 -  2580 - ReadSiteConfig: Done reading, found 2 rules (0 errors, 1 warnings) on 8 lines

You should fix that.

Also - After that sequence in the IIRF.log, there is no indication that any further request was received.  You had written, it seems like the iirf is recieving the request, which is great. but, it does not rewrite the url.  But this does not appear to be the case judging from the IIRF log that you posted.

Now, regarding your most recent message... In that one, you wrote: but then when i try to use RewriteRule  ^/feedbacks  /feedback.aspx its not working.  I understand what you have written but I do not see any request arriving at IIRF that looks like /feedbacks.  I see a request arriving at IIRF that looks like '/' (an empty URL), and it appears that it gets redirected to yahoo.com as you wanted. So IIRF is functioning properly.

Now, look at the rule in your IIRF.ini for /feedbacks.  It is not actually matching on /feedbacks, but rather /httpdocs/feedbacks.  I don't know why that is the case.  If you have a vdir rooted at /httpdocs, then you need to put an iirf.ini file in the physical directory for that vdir.  The root vdir will receive a request only if there is no other vdir with a matching URL path.  What I mean is, /httpdocs/feedbacks will arrive at the root vdir -and that is apparently the vdir to which the IIRF.ini you are working with applies - only if no vdir exists that maps to a url path of /httpdocs.  If you don't understand what I just wrote, you need to read up on vdirs and url paths in the IIRF documentation or the IIS documentation. 

Having said all that, I see no request for /feedbacks or /httpdocs/feedbacks in the IIRF log. This means that IIRF never saw that request. You need to fix that problem in order to see the rewriterule actually work.  IIRF cannot rewrite a request that it does not receive.