mnot’s Weblog

Design depends largely on constraints.” — Charles Eames

Sunday, 23 October 2005

Emulating W3C ,tools with mod_rewrite

I don't know if this has already been done (it's not exactly rocket science), but for the benefit of those who want to emulate the W3C's cool ,tools functions with mod_rewrite;

# tools
RewriteRule ^(.*),validate http://validator.w3.org/check?uri=http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),checklink http://validator.w3.org/checklink?uri=http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),rchecklink http://validator.w3.org/checklink?recursive=on&uri=http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),text http://cgi.w3.org/cgi-bin/html2txt?url=http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),cssvalidate http://jigsaw.w3.org/css-validator/validator?usermedium=all&uri=http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),links http://www.google.com/search?as_lq=http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),blinks http://blogsearch.google.com/blogsearch?scoring=d&q=link:http://%{HTTP_HOST}/$1 [L,R]
RewriteRule ^(.*),cacheability http://www.ircache.net/cgi-bin/cacheability.py?descend=on&query=http://%{HTTP_HOST}/$1 [L,R]

For example, you can validate this page.


Filed under: Web

discussion of this entry

ingo said…

%{HOST} should do the trick.

Sunday, October 23 2005 at 2:59 PM +10:00

ingo said…

arg. make that %{HTTP_HOST}.

Sunday, October 23 2005 at 3:00 PM +10:00

Mark Nottingham said…

Fixed; thanks, Ingo!

Sunday, October 23 2005 at 9:33 PM +10:00

add to the discussion

your details

name
e-mail address

Your e-mail address will not be shared.

your comment

Separate paragraphs with blank lines; HTML markup will be removed.

By submitting a comment, you agree to grant a limited license to reproduce it, under the same terms as the page being commented upon. If you have questions or prefer other terms, please contact me.

Creative Commons License