Forum: Ruby on Rails html extension?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5d17446f8fdd822396c21a20b10ce8df?d=identicon&s=25 Blizzard Media (Guest)
on 2006-03-07 01:20
(Received via mailing list)
First off please forgive me if this has been asked a thousand times.  I
have searched google without any luck.  Basically what I would like to
do is output the url with an html extension.  Maybe an example would
help.  If I have in my controller:



def index

  some stuff

end



I would get something like http://mysite/index

I would like to convert is somehow to http://mysite/index.html



Is there a way to do this easily like with a rewrite rule in .htaccess
or maybe some configuration in routes.rb ?
Bf66e10c8fc4abefebde0425e7f6f15a?d=identicon&s=25 Norman Timmler (Guest)
on 2006-03-07 09:53
(Received via mailing list)
Am Montag, den 06.03.2006, 19:19 -0500 schrieb Blizzard Media:
>
> Is there a way to do this easily like with a rewrite rule in .htaccess
> or maybe some configuration in routes.rb ?

In your .htaccess file you can do:

RewriteEngine On
RewriteRule (.*).html $1

--
Norman Timmler

http://blog.inlet-media.de
This topic is locked and can not be replied to.