Tokyo photo book : Streets Without Names
emuu.net
opinions and images by m. werneburg since 1998
adventures · creations · articles · photo · journal · about me

turning your (webserver's) frowns into smiles

Tokyo, 2010.07.31

Here's a trick I found suggested in a comment on a site explaining the configuration of some web server software.

If you get a request for something that's not a valid resource on your website, simply turn that request into a search for that content on your site. It all hinges on configuring your server to redirect the requests to a certain search engine URL.

I like DuckDuckGo these days (a lot) so I've turned any "not found" request into a DuckDuckGo search. For instance, try http://emuu.net/beamsville or http://emuu.net/banana or http://emuu.net/calamity.

You'll note that I used the target URL http://duckduckgo.com/?q=site%3Aemuu.net+ and simply append the searched-for term.

I've done the same on the company's website (using Google Japan for search results instead) in my nginx.conf as follows:

if (!-f $request_filename) {
rewrite /(.*) http://www.google.co.jp/search?hl=ja&q=site%3Acaritas.co.jp+$1
break;
}

Tokyo photo book

photo of the day

what's new

tools

rand()m quote

Capitalism is Man Exploiting Man; Communism is just the opposite.
--Old East Block Joke

recommended

copyright

Creative Commons License
streets without names
reader comments
comment
name
email
website

I recommend these journals and blogs.