[英]How to redirect uri to suburi with rails
I've read up on how to use config.action_controller.relative_url_root to set a sub uri in rails and I plan to set my site to www.mydomain.com/mysub_uri. 我已经阅读了有关如何使用config.action_controller.relative_url_root在rails中设置sub uri的信息,并且我计划将我的网站设置为www.mydomain.com/mysub_uri。
What I would like thought is for www.mydomain.com to redirect automatically to www.mydoamin.com/mysub_uri. 我想让www.mydomain.com自动重定向到www.mydoamin.com/mysub_uri。
How do I go about doing this? 我该怎么做呢? I am using rails, apache, and phusion.
我正在使用rails,apache和phusion。
Thanks! 谢谢!
You could do this with an Apache rewrite (completely independent of Rails). 您可以通过Apache重写(完全独立于Rails)来做到这一点。 Check the docs here: http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
在此处检查文档: http : //httpd.apache.org/docs/2.0/misc/rewriteguide.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.