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:
- Open your 404 page Settings
- 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>
- 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