Home > Technical & Creative Skills > Programming, Servers & Scripts

"Funny" 404 Page for your domains (7)


04-27-2020 02:18 AM #1 guriboy007 (Member)
"Funny" 404 Page for your domains

What's up guys,

So I dont usually post much here, actually not at all, but I decided to share a little piece of script that I've used to avoid showing the 404 503 etc errors on my domains.

I always liked to play around with domains, and I usually add some tricky codes on my landers, so i decided to make a gif generator on my error pages, well actually isn't anything fancy, is just a simple iframe that gets the keyword you put into giphy.com website.

So for the code is very simple, on your .htaccess file in the root of your host, you will add the following:

Code:
Options -Indexes

ErrorDocument 403 /nope.html
ErrorDocument 404 /nope.html
ErrorDocument 500 /nope.html
This will make the errors 403, 403, and 500 to redirect to the nope.html page.

Then go ahead create this nope.html page in the root of your hosting, and add the following:

Code:
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Hell nah bro</title>
	<style>
	body, html {
	  height: 100%;
	}
	body {
		background-color:black;
	}
</style>
</head>
<body>
	<iframe src="https://giphy.com/tv/search/hell-no" width="480" height="480" frameBorder="0" style="position:absolute; top:24%; left:50%;margin-left: -240px; clip:rect(55px,480px,425px,0px);" ></iframe><p>
</body>
</html>

So basically, it will just put an iframe in the middle of your page, with a random gif of the keyword you added. you can do this in this part of the code at the nope.html page <iframe src="https://giphy.com/tv/search/hell-no" width="480" height="48 the keyword in this case is "hell-no" (you will to add "-" instead of spaces)

[B]You can find an example here: http://cesarfarias.me/typewhateveruwant everytime you refresh the page some random "hell-no" gif will appear

Other funny gifs to warn people going thru your urls and trying to sniff around would be (replace the iframe url):

https://giphy.com/tv/search/gtfo
https://giphy.com/tv/search/get-out
https://giphy.com/tv/search/nice-try
https://giphy.com/tv/search/smh
https://giphy.com/tv/search/calling-cops


That's all.


04-27-2020 02:40 AM #2 affpayinggao (Veteran Member)

Really interesting, thanks for sharing


04-27-2020 05:47 AM #3 jack_l (Veteran Member)

Good share man


04-27-2020 12:50 PM #4 matuloo (Legendary Moderator)

I've seen quite a few interesting 404 (or the other error codes) pages over the years, some people get really creative

Thanks for sharing your approach


04-27-2020 01:22 PM #5 platinum (Veteran Member)

Interesting indeed!

I wonder if you've tried sending visitors to a list of random offers landing page and were able to somehow monetize those visits.


04-27-2020 06:24 PM #6 guriboy007 (Member)

Quote Originally Posted by platinum View Post
Interesting indeed!

I wonder if you've tried sending visitors to a list of random offers landing page and were able to somehow monetize those visits.
Yup, i mean you can edit the html page the way as you like. Google adsense would be hard, i think they don't accept ads on 404 pages. However traffic on 404 aren't much. I used to do this mostly cause my pages would be like /lander1 /lander2 /lander3 and so on, then people would be trying to find landers on my domains to steal and i just thought it would be funny to do that haha

But if you want to monetize, i'd recommend adding some push notification subscription, and then after they subscribe to push, send to some smartlink sweepstake.


04-27-2020 08:14 PM #7 matuloo (Legendary Moderator)

Quote Originally Posted by platinum View Post
Interesting indeed!

I wonder if you've tried sending visitors to a list of random offers landing page and were able to somehow monetize those visits.
I'm doing this, once in a while I'm doing a cleanup and deleting some old LPs, pages, listicles etc... and redirect them to 404 page with a LP that corresponds with the vertical of the original pages. Some of them are getting traffic and making some leads. On top of that, I do setup 404 pages on pretty much all domains that I use and those are also standard LPs related to the vertical of what I registered the domain for.

The extra income is nothing significant but it still counts


Home > Technical & Creative Skills > Programming, Servers & Scripts