URL Redirects with Mongrel

From A2Wiki

Jump to: navigation, search

.htaccess redirects will not work in Mongrel accelerated Rails applications, insetead you'll need to do the following:

  • Create a file named mongrel.conf in your Rails app's config directory.
  • Enter your redirects in this file in the following format (one per line):
redirect "/from_url", "/to_url"
  • Stop mogrel:
cd ~ 
cd your_rails_app 
mongrel_rails stop
  • Start mongrel specifying location of mongrel.conf with -S:
cd ~ 
cd your_rails_app 
mongrel_rails start -S config/mongrel.conf  -d -p [portno] -e production < /dev/null >& /dev/null exit

Where [portno] is the port number you were assigned for your Mongrel instance.

Personal tools