viewpoint-particle

Author Topic: Redirect  (Read 328 times)

JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Redirect
« on: June 09, 2017, 01:04:59 pm »
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

  • Tech Support
  • *****
  • Posts: 2114
    • WinBatch
Re: Redirect
« Reply #1 on: June 09, 2017, 01:36:23 pm »
Ever tried to WebOut a 303 header?

HTTP/1.1 303 See Other
Location: http://whatever.org/index.html
"le succès est une terrible maîtresse"
(French translation), Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Re: Redirect
« Reply #2 on: June 09, 2017, 01:39:46 pm »
No.  I generally use this method.   Any advantage with the 303?   Any chance of a WebOutRedirect() function?

Jim

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

td

  • Tech Support
  • *****
  • Posts: 2114
    • WinBatch
Re: Redirect
« Reply #3 on: June 09, 2017, 10:49:49 pm »
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.
"le succès est une terrible maîtresse"
(French translation), Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Re: Redirect
« Reply #4 on: June 10, 2017, 07:45:13 am »
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

  • Tech Support
  • *****
  • Posts: 2114
    • WinBatch
Re: Redirect
« Reply #5 on: June 10, 2017, 08:33:05 am »
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
;;; 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.
 
"le succès est une terrible maîtresse"
(French translation), Bill Gates


JTaylor

  • Pundit
  • *****
  • Posts: 743
    • Data & Stuff Inc.
Re: Redirect
« Reply #6 on: June 10, 2017, 08:48:20 am »
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

  • Tech Support
  • *****
  • Posts: 2114
    • WinBatch
Re: Redirect
« Reply #7 on: June 10, 2017, 01:40:30 pm »
Code: Winbatch
#definefunction WebOutRedirect(_url)
   return WebOut('HTTP/1.1 303 See Other':@CRLF:'Location: ':_url,2)
#endfunction
 
"le succès est une terrible maîtresse"
(French translation), Bill Gates