Redirect

Started by JTaylor, June 09, 2017, 01:04:59 PM

Previous topic - Next topic

JTaylor

Hopefully I haven't overlooked anything and not sure if I have requested this feature before but looking for a direct way to redirect from a ".web" file to a new address like PERL does with

    print $query->redirect($url);

I know of at least one way to get there but a bit clunky.   Having a WebBatch function would be GREATLY appreciated.

Thanks.

Jim

td

Ever tried to WebOut a 303 header?

HTTP/1.1 303 See Other
Location: http://whatever.org/index.html
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

No.  I generally use this method.   Any advantage with the 303?   Any chance of a WebOutRedirect() function?

Jim

Code (html5) Select

<head>
<meta http-equiv="Refresh" content="0;url=https://www.w3schools.com">
</head>

td

A 301 or 303 is handled at the http protocol level which means it should require less overhead and be more efficient than an html header.   I would be very surprised if your PERL "redirect" did anything more than issue a http 301 header.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

Okay.  Thanks.   If you get bored and are looking for something to do, having something like that as a function would be nice though :)

Thanks again.

Jim

td

An experienced software architect would say that loading up a product with trivial functions doesn't improve the product for users.  It does quite the opposite.  What it apparent is that an effort needs to be made to restore the solution sharing community that the old WebBoard once was. 

Code (winbatch) Select
;;; redirect.web

; Could be any 30x redirect depending on need.
WebOut('HTTP/1.1 303 See Other':@CRLF:'Location: http://www.winbatch.com/index.html',2) ; 2 required to indicate a header end.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

JTaylor

I agree on both points.    I try not to ask for the first and to do my part on the second.

Guess I didn't see it as trivial.   There is WebOutFile so thought WebOutURL would be appropriate as well.

In any event, thanks.

Jim

td

Code (winbatch) Select
#definefunction WebOutRedirect(_url)
   return WebOut('HTTP/1.1 303 See Other':@CRLF:'Location: ':_url,2)
#endfunction

"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade