I have been reading the article and I have a couple of questions before I really get into this - and it is about the web.config file.
Here is what I now have in my web.config (below);
<!-- IIS 7 Script Map Configuration --> <system.webServer> <rewrite> <rules> <rule name="ExtensionLessUrls" patternSyntax="Wildcard" stopProcessing="true"> <match url="*.*" negate="true" /> <conditions> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> </conditions> <action type="Rewrite" url="PURLHandler.m1" appendQueryString="true" /> </rule> </rules> </rewrite> <validation validateIntegratedModeConfiguration="false" /> <handlers> <add name=".M1_wconnect-module" path="*.m1" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" /> <add name=".wwsoap_wconnect-module" path="*.wwsoap" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" /> <add name=".wc_wconnect-module" path="*.wc" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" /> <add name=".wcs_wconnect-module" path="*.wcs" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" /> <add name=".wcsx_wconnect-module" path="*.wcsx" verb="*" type="Westwind.WebConnection.WebConnectionHandler,WebConnectionModule" preCondition="integratedMode" /> </handlers> <httpErors defaultResponseMode="Redirect"> <remove statusCode="404" subStatusCode="-1" /> <error statusCode="404" prefixLanguageFilePath="" path="/PURLHandler.m1" responseMode="ExecuteURL" /> <error statusCode="404" subStatusCode="0" path="/PURLHandler.m1" responseMode="ExecuteURL" /> <error statusCode="404" subStatusCode="1" path="/PURLHandler.m1" responseMode="ExecuteURL" /> <error statusCode="404" subStatusCode="2" path="/PURLHandler.m1" responseMode="ExecuteURL" /> </httpErrors> <defaultDocument> <files> <add value="getpin.m1" /> </files> </defaultDocument> <httpRedirect enabled="false" destination="" /> </system.webServer>
As you can see I tried to redirect the HTTP errors via the default Response Mode.
But here's the weird thing; I noticed a typo in how IIS wrote the '<httpErors defaultResponseMode="Redirect">' as it should read '<httpErrors defaultResponseMode="Redirect">'.
I installed the code you suggested from the blog (as shown above) and the trapping for the extentionless PURL works!
Not sure if it is the typo or if it's the added module! (just kidding!)
Naturally now I must handle the management of the received string, but, it appears the trapping of the 404 error works.
Now I added your code from your blog note
LOCAL lcOrigUrl, lnItems, loRewrite, lcQuery, lnX LOCAL ARRAY laTokens[1] *** Rewrite URL injects the original URL as a Server Variable lcOrigUrl = Request.ServerVariables("HTTP_X_ORIGINAL_URL") IF EMPTY(lcOrigUrl) lcOrigUrl = Request.GetExtraHeader("HTTP_X_ORIGINAL_URL") IF EMPTY(lcOrigUrl) *** or pull it off the querystring lcOrigUrl = Request.QueryString("url") ENDIF ENDIF
The wonderful this is, the lcOrigUrl presents exactly as I had hoped. That is, it traps and returns the string perfectly!
Thanks again Rick!
Serge