Javascript known as an important element to build a website or blog. With this language you can use conditional cases. Many logical instruc...
Javascript known as an important element to build a website or blog. With this language you can use conditional cases.
Many logical instruction we can make with javascript. It is not to hard to apply. Especially if you build your website with blogger (Google) or wordpress.
So far, Build a blog or website with blogger or wordpress is the most choice for beginner. It mean you can apply this easy.
If you build your website with another CMS or build by self-coding. You can use it too, as long as it using javascript.
What is 404 Page?
404 Page is a page in a blog or website when visitor(s) try to search something in your web, then they do not find. We can say in simply, there is no information about what visitor search in your web.
Visitor will be brought to 404 page. It is usual for a blog. For instance, You can click this link (this example without redirecting) : https://en.cekrisna.com/2021/07/go-baby-go.html
I have a recommendation for you. It will be nice if you redirecting 404 page to another page/link. The benefit is you get 1 clik/or pageview to the page. And now, how to do that?
[post_ads]
Javascript Code Redirecting 404 Page
We will use javascript function here. We will apply this code in your. The code is in box below.
[lock]
[ <script> window.location.href = 'https://www.example.com'; </script> ]
[/lock]
Change https://www.example.com with your destination link. Where I have to put that code?
Blogger/Blogspot
After you sign in to your blogger account dashboar. The go to Setting - Errors and Redirects - custom 404. Click on that.
Then put javascript code above in the box. Last, Save your setting.
[post_ads_2]
[CAWD-550 Ruru Mishiro https://mixdrop.co/f/4neopz9wfk36gl]
Wordpress and other
Another CMS or web building platform. Put the code above </body> tag. Yes, sure in your template document.
Or for Wordpress user, you can place the code in the box with HTML/Javascript code allowed.
Okay that all the code and tutorial, if you can not do it, you can comment here. I will help you.
COMMENTS