08-20-2014 02:33 PM
well you can build your 404.html to redirect with a GET and pass original call as a parameter. Just a very initial thought, I have not tried to do it.
08-20-2014 03:26 PM
@1984 wrote:
well you can build your 404.html to redirect with a GET and pass original call as a parameter. Just a very initial thought, I have not tried to do it.
I think the the request uri is already lost by the time the 404.html loads. I believe the solution requires configuring the ErrorDocument funciton in AppWeb to populate a redirect_uri variable in the header or something other AppWeb configuration change.
I'm new to the gorey details of web server configuration. I'll keep plodding up the AppWeb configuration learning curve and see what I find.
08-20-2014 03:49 PM
Yeah... I am not aware of the details either. But I know you can run your labview code in the case of the 404 error by doing the stuff above.
08-20-2014 04:01 PM - edited 08-20-2014 04:25 PM
Victory! (EDIT: The smileys below should be a : followed by an o. I don't see how to supress this conversion. )
I modified the config file for the LabVIEW web server in a manner similar to Tanner B. I added this line instead.
ErrorDocument 404 "/mywebservice/404?QUERY=${request:originalUri}"
This launches the 404.vi I created, with the original query appended.
For example if one requests "/mywebservice/missingVI?param1=53¶m2=xyz", the 404.vi is called and the REQUEST_URI request variable is populated correctly with "/mywebservice/404?QUERY=/mywebservice/missingVI?param1=53¶m2=xyz".
I found the {request:originalUri} token in the AppWeb 5.0 documentation at http://appwebserver.org/products/appweb/doc/guide/appweb/users/routing.html . I used the 5.0 version of the documentation but I don't actually know which version is packaged with my LV version, LV2013sp1.
I see three tokens which one might choose to pass as parameters to the 404.vi. For my purposes I'm using {request:originalUri}.
{request:originalUri} - the entire uri (ie /mywebservice/missingVI?param1=53¶m2=xyz)
{request:query} - only the parameters part of the uri (ie param1=53¶m2=xyz)
{request:uri} - only the part of the uri prior to parameters (ie /mywebservice/missingVI)
thanks,
Martin
08-20-2014 09:09 PM
@mjaspan wrote:
(EDIT: The smileys below should be a : followed by an o. I don't see how to supress this conversion. )
The automatic conversion to an emoticon is something you can fix. It is a setting that causes the way the message is displayed to you to be messed up.
Dig through your profile settings for the forum. Under Preferences / Display, set your emoticon type to none. Now it won't automatically convert certain character combinations to smileys.