BREAKING NEWS

728x90

468x60

Main Menu

How to Redirect Automatic Error 404 Page To Homepage With Javascript

Blogboosters
-
August 21, 2018

Blogboosters.net - How To Redirect Error 404 Pages To Homepage With Javascript - It could be that a blog has an error page 404 or a page not found. Usually, the page has been deleted or by other causes such as writing errors in posting URLs, and others.

For that, usually a blog or web create a page or landing page specifically for error 404 page by giving a statement that the destination page has been deleted or no longer exists. The rest is given a button to the homepage or provided a search box to search for the desired post again.

Now this time I will give a trick to automatically redirect or redirect the error 404 page to the compilation so that visitors do not need to click the button to the homepage.

Actually, posts like this have a lot on Google, but there are Blogboosters friends who have difficulty implementing it because the script does not work in some templates, especially templates that use conditional tags for error 404 pages.

If you want to try it, please copy the following javascript code and save it above the code </body>or &lt;!--</body>--&gt; &lt;/body&gt;

The above code will automatically redirect the error 404 page to the homepage after 8 seconds so that visitors can still read the message on the error 404 page, you can set/change the number 8000to set the waiting time. 1 second = 1000.