Streaming live at 10am (PST)

Redirect your Custom 404 page to page within project - Tutorial


#1

Hello guys, this morning I faced requirement:

“When user is redirected to 404 page, we want to show 404 page briefly and then redirect user to another page.”

Solution is simple:

  1. Open your 404 page Settings
  2. Into Custom code into section “Inside head tag” add following code
<script>
  setTimeout(function (){
    window.open('http://www.yoursiteAddress.com/your-site', '_self');
  }.bind(this), 2000);
</script>
  1. Publish and voilá - after 2 seconds (2000 miliseconds) the page redirects user to http://www.yoursiteAddress.com/your-site. Just change this string accordingly.

If you wish to change delay - change the 2000 to any number you want.

Cheers,
Jarda


#2

Non-JS solution