Re: typo. That's weird. IIS did this or did this happen from manual changing of the file? If you run your app with this it should fail outright since web.config will be invalid... If that's not the case you might be looking at the wrong web.config file.
For the approach I'm suggesting using UrlRewrite you won't need the 404 error handlers so you should be able to remove that httpErrors completely.
+++ Rick ---
Rick,
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
Take a look at this new blog post:
Extensionless Urls with Web Connection and the IIS UrlRewrite Module
which should let you do what you need to.
+++ Rick ---
Often we use a login form or a login panel to authenticate users and initiate a session for the user. Othertimes we may use something like id=& and pull the details out of the querystring.
However, how do we handle PURL's [personalized URL's]. For example say we have a website like www.MyWebsite.COM.
We do some marketing for the user and send them a direct mail piece to Jack Schitt that say's;
"Jack to your personalized page at www.MyWebsite.com/JackSchitt"
Upon loading the page whatever process will lookup the key JackSchitt and understand that the first name is Jack, last name is Schitt and so on.
I guess what I would like to know if Web Connect, is there a way to do this? Packages like Mind Fire, EasyPURL and so on have this technology and I know their systems have limited data capabilities.
thx.
Serge
West Wind Technologies
Making waves on the Web
from Maui, Hawaii