From: Tobias Reif Date: 2001-11-28T20:44:44+09:00 Subject: [ruby-talk:26767] Re: CGI James Britt (rubydev) wrote: > FWIW, I don't have access to the Apache conf files on rubyxml.com, so > directory-specific .htaccess files help out. Thanks for the tips; my online server (.htaccess disabled) is all set up, thanks to Guy. My questions were just about my local one; there I can edit httpd.conf > You can also serve up Ruby-generated SVG files this way. Set up a > directory where anything ending in .svg gets processed as a ruby > script; just make sure they *are* ruby scripts. The files may need >to emit the correct content-type info. .rb in URLs promotes Ruby ;) So on rubynewbies.com, I have .svg for static SVGs, and .rb for Ruby programs. The latter serve XHTML, text, or SVG, and generate the appropriate MIMEtype. This is more flexible than associating MIMEtypes with extensions: one file for example can serve SVG with content-type image/svg+xml; if there's an error, it gets served with text/plain. Then there's http://www.rubynewbies.com/~tobi/show_source.rb?file=show_source.rb&format=.xhtml which serves XHTML or text, depending on the params. If the extension of the program were .xhtml, it would be wrong if text/plain is requested. If it were .txt, it would wrong if XHTML is requested. So static files have static extensions and MIMEtypes, and dynamic files have one extension, and flexible MIMEtypes. There are many different ways that work; this one works for me :) Tobi -- Tobias Reif http://www.pinkjuice.com/myDigitalProfile.xhtml go_to('www.ruby-lang.org').get(ruby).play.create.have_fun http://www.pinkjuice.com/ruby/