mod_ruby and Apache ForceType

G

George Moschovitis

Hello everyone,

I am trying to use the ForceType directive of apache
to get more readable urls, like this php based example:

<Files *>
ForceType application/x-httpd-php
</Files>

Does anyone know what is the equivalent of
application/x-httpd-php for mod_ruby?

I tried the following but failed:

AddType application/x-httpd-ruby .sx
AddHandler ruby-object .sx
<Files *>
ForceType application/x-httpd-ruby
</Files>

Any help will be really appreciated!

George Moschovitis
 
C

Carl Youngblood

One other approach that I've used is to use mod_rewrite to cause some
scripts to be interpreted as ruby scripts. In this case I am causing
certain URLS to be transparently redirected to a fastcgi script that
happens to be a ruby script:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteLog logs/rewrite_log
RewriteLogLevel 0

# don't use controller to process requests for static files
RewriteCond %{REQUEST_URI} .*\.(gif|jpg|png|css|js)$
RewriteRule .* - [L]

# send all other requests into the controller ruby script
RewriteRule ^.*$ /controller.fcgi [L,T=fastcgi-script]
</IfModule>
 
D

Dick Davies

Can't answer directly , but isn't this the same as

<Files *>
SetHandler ruby-object
RubyHandler Apache::ERubyRun.instance
</Files>

(for eruby)

or
<Files *>
Options +ExecCGI
SetHandler ruby-object
RubyHandler Apache::RubyRun.instance
</Files>

(for ruby cgi type scripts)


I'd replace the <Files> above with a <FilesMatch> to
exclude images etc.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top