viewpoint-particle
WinBatch Technical Support Forum
Welcome,
Guest
. Please
login
or
register
.
Did you miss your
activation email
?
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Current release
:
2023C (6.23CWC)
Home
Help
Search
Tech Database
Documentation
Downloads
Hints
Login
Register
WinBatch® Technical Support Forum
»
All Things WinBatch
»
WebBatch
»
Redirect
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Redirect (Read 5869 times)
JTaylor
Pundit
Posts: 1907
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
Logged
td
Tech Support
Posts: 4275
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
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
JTaylor
Pundit
Posts: 1907
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
>
Logged
td
Tech Support
Posts: 4275
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.
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
JTaylor
Pundit
Posts: 1907
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
Logged
td
Tech Support
Posts: 4275
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.
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
JTaylor
Pundit
Posts: 1907
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
Logged
td
Tech Support
Posts: 4275
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
Logged
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
- Dr. Tom Cade
Print
Pages: [
1
]
Go Up
« previous
next »
WinBatch® Technical Support Forum
»
All Things WinBatch
»
WebBatch
»
Redirect