# HandleURL redirection

**URL:** <https://forum.xojo.com/t/handleurl-redirection/33620>\
**Category:** Web\
**Created:** [September 27, 2016, 7:59am UTC](https://forum.xojo.com/t/handleurl-redirection/33620 "2016-09-27T07:59:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wayne\_Golding](https://forum.xojo.com/user_avatar/forum.xojo.com/wayne_golding/32/165_2.png) [@Wayne\_Golding](https://forum.xojo.com/u/Wayne_Golding)\
**Post date:** [September 27, 2016, 7:59am UTC](https://forum.xojo.com/t/handleurl-redirection/33620/1 "2016-09-27T07:59:32Z")

</div>

I know I can set the status to 3xx to get the browser to immediately load a target, and I can use `<meta http-equiv="refresh" content="5;URL='http://www.example.com/'" />` to load after a period of time, but is there a better way? ShowURL seems obvious, but I don’t have a control/session available at this point to use that mechanism.

---

<div class="post-metadata">

**Author:** ![Michel\_Bujardet](https://forum.xojo.com/user_avatar/forum.xojo.com/michel_bujardet/32/252_2.png) [@Michel\_Bujardet](https://forum.xojo.com/u/Michel_Bujardet)\
**Post date:** [September 27, 2016, 9:21am UTC](https://forum.xojo.com/t/handleurl-redirection/33620/2 "2016-09-27T09:21:43Z")

</div>

You can use JavaScript `window.location=<url>`

[http://www.w3schools.com/js/js\_window\_location.asp](http://www.w3schools.com/js/js_window_location.asp)

---

<div class="post-metadata">

**Author:** ![Greg\_O\_Lone](https://forum.xojo.com/user_avatar/forum.xojo.com/greg_o_lone/32/49_2.png) [@Greg\_O\_Lone](https://forum.xojo.com/u/Greg_O_Lone)\
**Post date:** [September 27, 2016, 11:45am UTC](https://forum.xojo.com/t/handleurl-redirection/33620/3 "2016-09-27T11:45:43Z")

</div>

> [@288795:@Wayne Golding](#):
>
> I know I can set the status to 3xx to get the browser to immediately load a target, and I can use `<meta http-equiv="refresh" content="5;URL='http://www.example.com/'" />` to load after a period of time, but is there a better way? ShowURL seems obvious, but I don’t have a control/session available at this point to use that mechanism.

Use the 301 or a 302 redirect. It’ll save your app the time and resources of creating a session.

---

<div class="post-metadata">

**Author:** ![system](https://forum.xojo.com/uploads/default/original/1X/455b4dcc0e61630e9f81940004ddffa49c432a46.png) [@system](https://forum.xojo.com/u/system)\
**Post date:** [October 29, 2020, 6:28pm UTC](https://forum.xojo.com/t/handleurl-redirection/33620/4 "2020-10-29T18:28:52Z")

</div>


