!-f and !-d don't work for pages stored in SharePoint

Topics: Developer Forum, User Forum
Sep 30, 2009 at 11:18 AM
Edited Sep 30, 2009 at 12:43 PM

Hi I am new to the IIRF, regex and Isapi filter in general..

I am trying to make IIRF work for our website, where if the file or directory is removed from the site or moved then go to the public archive website and get the archived page. Here is the .ini file code:

RewriteLog  c:\temp\nILSLog.out
RewriteLogLevel 5
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RedirectRule ^(.*)$ http://<public_archive_site>/+/http://<oursite>$1 [R=301]

The problem here is we are using SharePoint and !-f and !-d always return true even if the file or directory is there [virtual], but NO physical directory exists. The funny part is that at first it was working fine, where I was able to check make it work for files that exists and it was redirecting perfectly if the file doesn't. but since many tweaking in the original lines, the behaviour is changed and now it's not working as expected! Could please somebody look at my code and let me know if I am missing something or if there is any other way of doing this? I also tried using REQUEST_URI instead of REQUEST_FILENAME but same results.

Any lead in this will be much appriciated.

Thanks and Regards,
Nilesh

This is the logfile:

Wed Sep 30 12:32:27 -  4148 - LogFile re-opened.
Wed Sep 30 12:32:27 -  4148 - AwaitIniChangeAndReinit:  TerminateWatch = FALSE
Wed Sep 30 12:32:27 -  4148 - FileChangeWatcher(): Await returns (TerminateWatch= FALSE)
Wed Sep 30 12:32:27 -  4148 - FileChangeWatcher: Await()...
Wed Sep 30 12:32:27 -  4148 - AwaitIniChangeAndReinit()...
Wed Sep 30 12:32:40 -  4148 - AwaitIniChangeAndReinit: watcher got something after 0 cycles of no changes...
Wed Sep 30 12:32:40 -  4148 - AwaitIniChangeAndReinit: Detected change in file 'IsapiRewrite4.ini'
Wed Sep 30 12:32:40 -  4148 - AwaitIniChangeAndReinit: Detected change in the  ini file 'F:\Download\URL Redirector\lib\IsapiRewrite4.ini'
Wed Sep 30 12:32:40 -  4148 - AwaitIniChangeAndReinit: Ionic ISAPI Rewriting Filter (IIRF) v1.2.16 R8
Wed Sep 30 12:32:40 -  4148 - ReadConfig
Wed Sep 30 12:32:40 -  4148 - LogFile re-opened.
Wed Sep 30 12:32:40 -  4148 - ReadConfig: new log file name: 'c:\temp\nILSLog.out.5116.log'
Wed Sep 30 12:32:40 -  4148 - ReadConfig: line 2: RewriteLogLevel 5
Wed Sep 30 12:32:40 -  4148 - ReadConfig: setting LogLevel to 5
Wed Sep 30 12:32:40 -  4148 - ReadConfig: line   3: RewriteCond %{REQUEST_FILENAME}                            !-d                                      
Wed Sep 30 12:32:40 -  4148 - ReadConfig: line   4: RewriteCond %{REQUEST_FILENAME}                            !-f                                      
Wed Sep 30 12:32:40 -  4148 - ReadConfig: line   5: RedirectRule (rule 1)  '^(.*)$'  'http://<public_archive_site>/+/http://<oursite>$1'  [R=301]
Wed Sep 30 12:32:40 -  4148 - ReadConfig: not a duplicate rule...
Wed Sep 30 12:32:40 -  4148 - ParseRuleModifierFlags: '[R=301]'
Wed Sep 30 12:32:40 -  4148 - ParseRuleModifierFlags: token 'R=301'
Wed Sep 30 12:35:50 -  4576 - DllMain THREAD_DETACH
Wed Sep 30 12:36:19 -  4552 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Sep 30 12:36:19 -  4552 - OnUrlMap: storing physical path (C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx), 67 bytes, in ptr (0x1c03f6c8)
Wed Sep 30 12:36:19 -  4552 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Sep 30 12:36:19 -  4552 - OnUrlMap: storing physical path (C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx), 67 bytes, in ptr (0x1c17fb40)
Wed Sep 30 12:36:19 -  1840 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Sep 30 12:36:19 -  1840 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Sep 30 12:36:19 -  1840 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Sep 30 12:36:19 -  1840 - HttpFilterProc: SF_NOTIFY_URL_MAP
Wed Sep 30 12:36:19 -  1840 - HttpFilterProc: SF_NOTIFY_AUTH_COMPLETE
Wed Sep 30 12:36:19 -  1840 - DoRewrites
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree: getting 'url'
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree - no joy (GetLastError()=1413)
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree: 128 bytes
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree: result ''
Wed Sep 30 12:36:19 -  1840 - GetHeader_AutoFree: getting 'url'
Wed Sep 30 12:36:19 -  1840 - GetHeader_AutoFree: 22 bytes   ptr:0x0EC0BA58
Wed Sep 30 12:36:19 -  1840 - GetHeader_AutoFree: 'url' = '/Pages/Home.aspx'
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree: getting 'QUERY_STRING'
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree: 1 bytes
Wed Sep 30 12:36:19 -  1840 - GetServerVariable_AutoFree: result ''
Wed Sep 30 12:36:19 -  1840 - GetHeader_AutoFree: getting 'method'
Wed Sep 30 12:36:19 -  1840 - GetHeader_AutoFree: 4 bytes   ptr:0x1C02D3C0
Wed Sep 30 12:36:19 -  1840 - GetHeader_AutoFree: 'method' = 'GET'
Wed Sep 30 12:36:19 -  1840 - DoRewrites: Url: '/Pages/Home.aspx'
Wed Sep 30 12:36:19 -  1840 - EvaluateRules: depth=0
Wed Sep 30 12:36:19 -  1840 - EvaluateRules: Rule 1 : 2 matches
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: getting 'REQUEST_FILENAME'
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: special variable name
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: 66 bytes
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: result 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ReplaceServerVariables: InputString='%{REQUEST_FILENAME}' out='C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: ts1 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: src='/Pages/Home.aspx','(null)' ReplacePattern='C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx' vec=[[  [  0, 21, 0, 21] [] ] counts=2,0
Wed Sep 30 12:36:19 -  1840 - ApplyCaseConversion: before 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ApplyCaseConversion: after  'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: result 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: checking 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx' against pattern '!-d'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: cond->SpecialConditionType= 'd'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Special: it is not a file; not a directory
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Special, retVal= True
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Child is non NULL (parent= 0x01157E98) (child= 0x011523F8)
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Current condition evaluates to TRUE
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Logical AND, ergo we evaluate the Child
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: getting 'REQUEST_FILENAME'
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: special variable name
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: 66 bytes
Wed Sep 30 12:36:19 -  1840 - GetServerVariable: result 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ReplaceServerVariables: VariableName='REQUEST_FILENAME' Value='C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ReplaceServerVariables: InputString='%{REQUEST_FILENAME}' out='C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: ts1 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: src='/Pages/Home.aspx','(null)' ReplacePattern='C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx' vec=[[  [  0, 21, 0, 21] [] ] counts=2,0
Wed Sep 30 12:36:19 -  1840 - ApplyCaseConversion: before 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ApplyCaseConversion: after  'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: result 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: checking 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx' against pattern '!-f'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: cond->SpecialConditionType= 'f'
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Special: it is not a file; not a directory
Wed Sep 30 12:36:19 -  1840 - EvalCondition: Special, retVal= True
Wed Sep 30 12:36:19 -  1840 - EvaluateCondition: Child is NULL
Wed Sep 30 12:36:19 -  1840 - EvalCondition: returning TRUE
Wed Sep 30 12:36:19 -  1840 - EvalCondition: returning TRUE
Wed Sep 30 12:36:19 -  1840 - EvalConditionList: rule 1, TRUE, Rule will apply
Wed Sep 30 12:36:19 -  1840 - ReplaceServerVariables: InputString='http://<public_archive_site>/+/http://<oursite>$1' out='http://<public_archive_site>/+/http://<oursite>$1'
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: src='/Pages/Home.aspx','(null)' ReplacePattern='http://<public_archive_site>/+/http://<oursite>$1' vec=[[  [  0, 21, 0, 21] [] ] counts=2,0
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: replacing ($1) with '/Pages/Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ApplyCaseConversion: before 'http://<public_archive_site>/+/http://<oursite>/Pages/Home.aspx'
Wed Sep 30 12:36:19 -  1840 - ApplyCaseConversion: after  'http://<public_archive_site>/+/http://<oursite>/Pages/Home.aspx'
Wed Sep 30 12:36:19 -  1840 - GenerateReplacementString: result 'http://<public_archive_site>/+/http://<oursite>/Pages/Home.aspx'
Wed Sep 30 12:36:19 -  1840 - EvaluateRules: Result (length 88): http://<public_archive_site>/+/http://<oursite>/Pages/Home.aspx
Wed Sep 30 12:36:19 -  1840 - EvaluateRules: returning 301
Wed Sep 30 12:36:19 -  1840 - DoRewrites: Redirect (code=301) Url to: 'http://<public_archive_site>/+/http://<oursite>/Pages/Home.aspx'
Wed Sep 30 12:37:31 -  4732 - DllMain THREAD_DETACH
Wed Sep 30 12:37:31 -  1172 - DllMain THREAD_DETACH
Wed Sep 30 12:38:01 -  2464 - DllMain THREAD_DETACH  

Coordinator
Sep 30, 2009 at 11:44 PM
Edited Sep 30, 2009 at 11:57 PM

Thanks for the clear question and thanks for including the log file.

> The problem here is we are using SharePoint and !-f and !-d always return true even if the file or directory is there [virtual], but NO physical directory exists.

Uh, I'm not clear on this.  Let's review.  -f returns TRUE if the prior argument is a file.  -d returns TRUE if the prior argument is a directory.  !-f returns FALSE if the prior argument is a file,  !-d returns FALSE if the prior arg is a directory.  They are negations.  Maybe you knew all this.

You chain these RewriteCond things together.  If you have these in your ini file:

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

...that pair of conditions, together, returns TRUE if the request filename is NOT a file and NOT a directory.

Now, looking at your log, I see that REQUEST_FILENAME is being resolved to 'C:\Inetpub\wwwroot\wss\VirtualDirectories\113\Pages\Home.aspx'. 

The test is then done on that file.  IIRF seems to think it is NOT a file, and NOT a directory.  The result of your two chained RewriteCond statements is thus TRUE. 

Is this not what you were expecting? 

Does that file exist on your machine?  (I don't know how sharepoint works).

If sharepoint stores these things in a database, and NOT in the filesystem, then any test of existence for a page managed by sharepoint will always return FALSE (and the negation always TRUE).  The test for a page NOT managed by sharepoint will also always return FALSE.  So, if sharepoint does not put pages into the filesystem, you cannot use -f as a way to see if the page exists.  Do you agree?

I would like to know... what are you trying to accomplish with that weird rule, anyway?  What is the deal with the strange-looking replacement pattern?  

 

Oct 1, 2009 at 10:07 AM
Edited Oct 1, 2009 at 10:50 AM

Thanks for quick reply Cheeso. I appriciate your effort wholeheartedly.

The strange looking replacement pattern is something for UK government requirement for archiving all the government sites, and system they've developed for UK government site archival.

from your explanation about the -f and -d, it looks like that it will not work in sharepoint as sharepoint stores everything in database. so, my question here [or what I am trying to achieve here is]:

I like to find out whether a URL request coming from a browser for a file or directory exist in our site [SharePoint so it's stored in Database], If it does, serve the page, if it doesn't, then go to the public archive site and fetch the page from the public archive site [the strange replacement pattern].

so, in the regex term I want:

RewriteCond {for if virtual file/directory or even if I can find out if the requested URL exist or not on the server [may be capture  404 error??!]}.

If yes, then serve the page to the user from our site. [RedirectRule]
If No, then take the user to Public archive website. [RedirectRule]

So, the red highlighted bit is the main issue here [so in nutshell, I like to capture a 404 [file not found] error and redirect the request to the public archive site], this my first attemp to write Regex and am not aware if there is a way to achive this through regex or not [there must be, as all the CMS systems nowadays used database to serve pages, so no physical pages, how do you handle it in IIRF/Regex?]

Is it possible to achive this with IIRF?

Thanks again for your help and looking forward to your response for this explanation. hope it's clear.

Regards,
Nilesh Vasave

 

 

 

Coordinator
Oct 1, 2009 at 3:38 PM

If I understand correctly, it seems you want the -f or -d equivalent for the Sharepoint database.  And I don't know how to do that.

The -f and -d check for filesystem presence.  If you cannot detect the file using Win32 APIs (which is what IIRF uses), then as far as the Windows filesystem is concerned, the file does not exist.

This is not a question of Regex.  Regular Expressions are a pattern matching language.  It has nothing to do with sharepoint, or virtual filesystems.

If I understand what you want, then you need to accomplish the check, within a page inside Sharepoint.

 

 

May 16, 2012 at 2:19 PM

Cheeso,

I should probably shout out to you directly.  I'm just posting on the related threads in case the original folks were still interested in why it wasn't working (most, probably, have wandered off or made peace with imperfection).

Is anyone still maintaining the code?  And what would the chances be of me getting my .INI option?


 



So...

The answer was never posted here, so I'll go ahead and bring this issue back up.  I may be able to describe it better than the previous poster.

 

The correct question is:

is it possible to change which request lifecycle event Ionics processes it's redirects on?

Take a look below at the information I've copied from the MetaBase for both Ionics and Sharepoint.  Specifically, notice the filter flags.  I know people have discussed before about making Ionics process priority "High" and then moving it to the top of the list. 

This doesn't actually work, and here is why:

Sharepoint is registering for the NotifyPreProcHeaders event... and is actually doing some of it's processing work there on that event.  This includes, but may not be limited to server.transfer implementation of the virtual _Layouts/ folder, or the little error page that is shown when you try to browse to a non-existent site in the site collection.  By the time Ionics gets the request in the NotifyUrlMap event (or NotifyAuthComplete) event, Sharepoint has already re-written the original request (if not completely hijacked it).

If we had an option in Ionics that allowed us to latch on (and process redirections) on the NotifyPreProcHeaders event, that would be really cool, and would allow us to finally step in front of Sharepoint once and for all.

This issue affects all versions of Ionics dealing with all versions of Sharepoint, and the examples I've seen of people claiming success with Sharepoint have all been limited and grounded in some kind of solution that only deals with the root of a site collection, not any URLs for a site in the collection (the "I fix SSL search" example, for example).

 

<IIsFilters Location ="/LM/W3SVC/1/Filters"
AdminACL="49634462f0000000a400000040000000114a7ddf570d89f6e3c994cc51fc3374a06ff2265ef375f71a75758c136b0eae4ed3410481120b1c9fb7bd67f74079e0234850519a1fe141c2ed22ec501ca9ceeac5382b238736ec38bc340c469c0b24e6c3a5cb837e27e16e4ce75f3c35d202016d1cb938809619c0d85496434c223b9fcec294e47282a8f667f10c00ed6d50c0c3ed6d2037eac340c2407b8c514d526eb46a8a0ed1f4d3364e504d5a517aa77827f0b77de0588669cdac88c9638f960fdf5b2c93b0f4728dec7db20a69889b570f1e830b574d4a81f6c3848ad1c15af977f19833e6142e2e4d88142eb01ff83992776a6ff77265"
FilterLoadOrder="Ionics Rewriter,stsfltr"
>
</IIsFilters>
<IIsFilter Location ="/LM/W3SVC/1/Filters/Ionics Rewriter"
FilterDescription="Ionic ISAPI Rewriting Filter (IIRF) v1.2.16 R8"
FilterFlags="NotifySecurePort | NotifyNonSecurePort | NotifyUrlMap | NotifyOrderHigh | NotifyAuthComplete"
FilterPath="D:\InetPub\IonicsIsapiReWriter\IsapiRewrite4.dll"
FilterState="1"
>
</IIsFilter>
<IIsFilter Location ="/LM/W3SVC/1/Filters/stsflt2"
FilterPath="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\bin\stsfltr.dll"
FilterState="1"
>
</IIsFilter>
<IIsFilter Location ="/LM/W3SVC/1/Filters/stsfltr"
FilterDescription="Microsoft SharePoint"
FilterEnableCache="TRUE"
FilterFlags="NotifySecurePort | NotifyNonSecurePort | NotifyPreProcHeaders | NotifyOrderHigh | NotifyAuthComplete"
FilterPath="C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\60\bin\stsfltr.dll"
FilterState="1"
>
</IIsFilter>

May 16, 2012 at 2:49 PM

Checking into the code (I'm not a C++ developer, just a plain ol' developer)... I find this:

#if 0
            case SF_NOTIFY_PREPROC_HEADERS:
                cfg = GetVdirConfigFromFilterContextCheckUpdate(pfc);
                LogMessage(3, "HttpFilterProc: SF_NOTIFY_PREPROC_HEADERS");
                return OnPreprocHeaders(pfc, (HTTP_FILTER_PREPROC_HEADERS *) pvNotification );
                break;
#endif

Which interests me because if I were to do my thing, this might be what it might look like.  Except I might make it look like this:

//#if 0
            case SF_NOTIFY_PREPROC_HEADERS:
                cfg = GetVdirConfigFromFilterContext(pfc);
                LogMessage(cfg, 3, "HttpFilterProc: SF_NOTIFY_PREPROC_HEADERS");
                //return OnPreprocHeaders(pfc, (HTTP_FILTER_PREPROC_HEADERS *) pvNotification );
				OnUrlMap( pfc, (HTTP_FILTER_PREPROC_HEADERS *) pvNotification );
                return OnAuthComplete(pfc, (HTTP_FILTER_AUTH_COMPLETE_INFO *) pvNotification );
                break;
//#endif

And of course, further up, I would need to uncomment the PreProc line:

    // security
    pVer->dwFlags |=  SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT ;

    // notification to allow pre-processing of headers
    pVer->dwFlags |= SF_NOTIFY_PREPROC_HEADERS;

    // we use AUTH_COMPLETE because more server variables are parsed by then.
    pVer->dwFlags |= SF_NOTIFY_AUTH_COMPLETE;

So that we would get the PreProc notifications.

 

So before I make a mess of things any further, Cheeso, perhaps you could step in and explain why PreProc was commented out?  I'm going to go test these changes for my purposes, but I think perhaps it was done so people could do redirects based on AUTH_USER ?

 

May 16, 2012 at 6:29 PM

Cheeso,

I went back to the 1.2 version and made these same changes (instead of calling OnPreprocHeaders() in the notification, I call OnUrlMap and then OnAuthComplete...

    // security
    pVer->dwFlags |=  SF_NOTIFY_SECURE_PORT | SF_NOTIFY_NONSECURE_PORT ;

    // notification to allow pre-processing of headers
    pVer->dwFlags |= SF_NOTIFY_PREPROC_HEADERS;

    // we use AUTH_COMPLETE because more server variables are parsed by then.
    pVer->dwFlags |= SF_NOTIFY_AUTH_COMPLETE;


switch ( dwNotificationType ) { //#if 0 case SF_NOTIFY_PREPROC_HEADERS: LogMessage(3, "HttpFilterProc: SF_NOTIFY_PREPROC_HEADERS"); OnUrlMap(pfc, (HTTP_FILTER_URL_MAP *) pvNotification ); return OnAuthComplete(pfc, (HTTP_FILTER_AUTH_COMPLETE_INFO *) pvNotification ); // return OnPreprocHeaders(pfc, // (HTTP_FILTER_PREPROC_HEADERS *) pvNotification ); break; //#endif

and it works for me.

Since I'm still using XP, I couldn't debug this change locally in the 2.1 code, and since I couldn't figure out how to turn a makefile into a Visual Studio solution, couldn't debug the 1.2 code locally either... but made the changes in the 1.2 source with Notepad and recompiled the .DLL and deployed it to one of my Sharepoint servers, and voila!

 

My redirect is occuring *before* Sharepoint snatches the request to do it's evil.

Since the code was commented out, I suspect you probably had a good reason for doing it... but as I'm the new guy 'round here, I don't actually know what the reason is.  I suppose if I leak all my memory and crash my production server, I'll know pretty quick, eh?  =)

 

Otherwise... two thumbs up for this project, man.  I'm inspired to learn more about C++.

May 16, 2012 at 7:49 PM

And one extra little note if anyone else is reading this:

I just noticed that I did lose my ability to query the AUTH_USER variable in my redirect rules, but I guess I would kinda expect that, since I'm redirecting before the Auth_Complete event.  But not a big deal in my case, I included an exception to the rule for me for debugging purposes.