[Rails] Rewrite domain root to MainController#index
"Luis G. Gómez"
lgomez at vfxnetwork.com
Sat Nov 20 00:32:01 GMT 2004
I'm confused.
There is a "RewriteRule ^$ /controller/action [R]" on line 23 of
a fresh intalation I just made. I uncommented it and changed
it to point to "RewriteRule ^$ /main/index [R]" but going to
"http://www.example.com/" keeps taking me to
"http://www.example.com/_doc/index.html"
I do have a "main_controller.rb" under app/ that contains:
require 'abstract_application'
require 'main_helper'
class MainController < AbstractApplicationController
include MainHelper
def index
render_text "Finally!!!"
end
end
But nothing...
:S
Thank you.
Tobias Luetke wrote:
> Or even easier :
>
> RewriteRule ^$ /controller/actionofmychoice
>
> Put this before the other rewrite rules. Rules are chained, so a later
> rule will make the correct transformation out of it.
>
>
> On Fri, 19 Nov 2004 14:01:32 -0800, Jeremy Kemper <jeremy at bitsweat.net> wrote:
>
>>-----BEGIN PGP SIGNED MESSAGE-----
>>Hash: SHA1
>>
>>Luis G. Gómez wrote:
>>| I want to hace a "main_controller.rb" hadle, among other actions,
>>| "index" without showing the user "http://www.example.com/main/index" but
>>| simply "http://www.example.com/".
>>
>>~ RewriteRule ^$ /dispatch.cgi?controller=main&action=index [QSA,L]
>>
>>For all its power, mod_rewrite can be pretty cryptic. The options at
>>the end of the rule (R, PT, L, etc) are critical. Check out the
>>mod_rewrite guide
>>(http://httpd.apache.org/docs-2.0/misc/rewriteguide.html) for a cookbook
>>of common problems & solutions.
>>
>>Best,
>>jeremy
>>-----BEGIN PGP SIGNATURE-----
>>Version: GnuPG v1.2.6 (Darwin)
>>Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
>>
>>iD8DBQFBnm08AQHALep9HFYRAunHAKC89mGkCEk0bgtQnsV5L1I9ykJIZACfY2CL
>>Nb0et90EIEGfA41lLvufvzg=
>>=iaU6
>>-----END PGP SIGNATURE-----
>>
>>
>>_______________________________________________
>>Rails mailing list
>>Rails at lists.rubyonrails.org
>>http://lists.rubyonrails.org/mailman/listinfo/rails
>>
>
>
>
More information about the Rails
mailing list