On 11/3/07, Casimir P <pikselNOSPAMMi / welnospmamho.com> wrote: > On Thu, 01 Nov 2007 15:42:59 -0500, justincollins wrote: > > > Casimir P wrote: > > >> Suppose I have some ruby code in a .rhtml -file, which is processed by > >> eruby. How can I get the url string of the page? (so I can chop it up). > >> > > > I think this depends somewhat on your environment [deleted some] > > but try adding > > > > puts ENV.inspect > > > > Yup. Hehe, kinda simple. Didnt find anything in-depth, but there was > enough in what I think most call the pickaxe. http://www.ruby-doc.org/docs/ > ProgrammingRuby/html/web.html (see code example at the end of "Using > Eruby"). > > What I wanted was to see what URI was requested, the bit after the domain, > ie.: > > <% puts ENV["REQUEST_URI"] %> > > Now, if I only could figure out how to redirect *all* requests to one and > the same .rhtml in the site root without actually rewriting the url user > sees... Already caused a few infinite redirect loops 8) For an Apache example, see any rails application (even an empty one), go to /public/ and read .htaccess