Erwin
2012-Nov-15 10:03 UTC
using Thin web server configuration in development , how to have eq. Apache RedirectMatch permanent
In production, using Apache I can use RedirectMatch permanent to force url
wo subdomain to use www.
<VirtualHost *:80>
ServerName example.com
RedirectMatch permanent ^/(.*) http://www.example.com/$1
</VirtualHost>
How can I get the same behavior when using Thin in dev mode ?
need to change all example.com/.. urls into www.example.com/.. if I
don''t want to touch the routes ?
thanks for feedback
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/rj12m9-7f2UJ.
For more options, visit https://groups.google.com/groups/opt_out.
Erwin
2012-Nov-15 10:26 UTC
Re: using Thin web server configuration in development , how to have eq. Apache RedirectMatch permanent
[SOLVED] but using Rails3 routes, maybe there is a better way ?
host = Rails.application.config.action_mailer.default_url_options[:host]
constraints(:host => host ) do
root :to => redirect("http://www.#{host}")
match ''/*path'', :to => redirect {|params|
"http://www.#{host}/#{params[:path]}"}
end
Le jeudi 15 novembre 2012 11:03:40 UTC+1, Erwin a écrit
:>
> In production, using Apache I can use RedirectMatch permanent to force url
> wo subdomain to use www.
>
> <VirtualHost *:80>
> ServerName example.com
> RedirectMatch permanent ^/(.*) http://www.example.com/$1
> </VirtualHost>
>
> How can I get the same behavior when using Thin in dev mode ?
> need to change all example.com/.. urls into www.example.com/.. if I
> don''t want to touch the routes ?
>
> thanks for feedback
>
--
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/PUCce4I5LZ8J.
For more options, visit https://groups.google.com/groups/opt_out.