Redirect 404 Not Found Page To Specific Page
Error 404 not found is one of the most frequently complained by website or blog owners. Error 404 is a warning that appears when your browser does not find the page you are accessing.
The 404 error page should indeed be addressed immediately so that it does not have a negative impact on the development of a website.
In addition to having a negative impact in the eyes of search engines such as Google, Bing, Yandex, etc., error pages are also not liked by visitors because they fail to find the information they want.
The cause of the 404 error
The appearance of the 404 not found error page can occur because of an intentional or unintentional error, it can be due to one's own fault or it could be because of what other people have done. Therefore, as a website or blog manager, you must always monitor the health of your website or blog.
The following are common causes of the 404 not found error, including:
- Wrong Entering URL : The cause of the first error is quite simple, namely an error typing or writing the URL.
- Caching error : This 404 error caching issue can also cause this error to appear, if the browser you are using cannot find the website cache file.
- Problematic DNS settings : Another factor that can cause a 404 to appear is a problem with your domain that has not propagated to the Domain Name System (DNS) in use.
- Problematic themes : In some cases problematic themes affect your website URL links.
How to automatically redirect 404 pages
In this way every visitor who accesses a 404 page will be automatically redirected to a certain page using Javascript. To do this, please follow the steps below.
1. Login to Blogger dashboard > select Theme > Edit HTML
2. Paste the code below above the tag </body>
<!--[ Redirect error 404 ]-->
<b:if cond='data:view.isError'>
<script>//<![CDATA[
KYM_redirect=setTimeout(function() {
location.pathname= '/';}, 2000);
//]]></script>
</b:if>
Take note! In the marked section.
- / is a short url that points to the Homepage, you can change it to a specific url
- 2000 is the lag time before the page is redirected, you can change as you wish
3. If you have! Save and see the result.
That's a short way on how to redirect a 404 page to a specific page.
.jpeg)
Post a Comment