Groups
Groups
Sign in
Groups
Groups
Ruby on Rails: Talk
Conversations
About
Send feedback
Help
using Thin web server configuration in development , how to have eq. Apache RedirectMatch permanent
18 views
Skip to first unread message
Erwin
unread,
Nov 15, 2012, 5:03:40 AM
11/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
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
Erwin
unread,
Nov 15, 2012, 5:26:43 AM
11/15/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to rubyonra...@googlegroups.com
[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
Reply all
Reply to author
Forward
0 new messages