Forum: Ruby on Rails URL rewrite to other domain for all local requests

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
blackflash (Guest)
on 2009-01-23 13:41
(Received via mailing list)
Is it possible to rewrite all URL's (routes) inside a rails app for
all local request to link to other domain if RAILS_ENV=test.

If I open the application at, then all
forms, links, etc, should make requests on

For example, if I make a get request on,
that contains something like:

<form method="post" action="/blogs">

and it should be changed with this:

<form method="post" action="

same for all other URL's.

It should be done in Rails, not in Apache server or similar.
This topic is locked and can not be replied to.