November 16, 2005 23:39 | WebTech

,tools

This is very very cool to me and one of those "duh! of course! simple brilliance!"

Emulating W3C ,tools with mod_rewrite

Basically, it allows a visitor to use their browser's Location input as a CLI (Command Line Interface) to any page on your site. The above-linked example offers only a few of the possibilities.

,validate
,checklink
,rchecklink
,text
,cssvalidate
,links
,blinks
,cacheability

Just added ,technorati

RewriteRule ^(.*),technorati http://www.technorati.com/search/%{HTTP_HOST}/$1 [L,R]

and using Google translation:
,en2de (german)
,en2fr (french)
,en2it (italian)
,en2sp (spanish)
,en2pt (portuguese)
,en2jp (japanese - baaad)
,en2ko (korean - baaad)
,en2zh-CN (simplified chinese - baaad)

RewriteRule ^(.*),en2de http://translate.google.com/translate?u=http://%{HTTP_HOST}/$1&langpair=en|de&hl=en&ie=UTF-8&oe=UTF-8&prev=/language_tools [L,R]
RewriteRule ^(.*),en2fr http://translate.google.com/translate?u=http://%{HTTP_HOST}/$1&langpair=en|fr&hl=en&ie=UTF-8&oe=UTF-8&prev=/language_tools [L,R]
RewriteRule ^(.*),en2sp http://translate.google.com/translate?u=http://%{HTTP_HOST}/$1&langpair=en|sp&hl=en&ie=UTF-8&oe=UTF-8&prev=/language_tools [L,R]
RewriteRule ^(.*),en2it http://translate.google.com/translate?u=http://%{HTTP_HOST}/$1&langpair=en|it&hl=en&ie=UTF-8&oe=UTF-8&prev=/language_tools [L,R]
RewriteRule ^(.*),en2pt http://translate.google.com/translate?u=http://%{HTTP_HOST}/$1&langpair=en|pt&hl=en&ie=UTF-8&oe=UTF-8&prev=/language_tools [L,R]
RewriteRule ^(.*),en2jp http://honyaku.yahoofs.jp/url_result?url=http://%{HTTP_HOST}/$1&setting=lang=ja|db=T|eid=CR-EJ&eid=CR-EJ&both=T [L,R]
RewriteRule ^(.*),en2zh-CN http://translate.google.com/translate?u=http://%{HTTP_HOST}/$1&langpair=en|zh-CN&hl=en&ie=UTF-8&oe=UTF-8&prev=/language_tools [L,R]

Comments