Building an application without redirect

39 views
Skip to first unread message

Thomas Sandmann

unread,
Jan 9, 2013, 12:26:11 PM1/9/13
to rr...@googlegroups.com
Dear Rook users,

I am running a Rook application through RApache (see Builder code below).
The application can be reached at http://myApp/index.rhtml

Pointing the browser to the base url http://myApp , on the other hand, returns the following html page:

OK
The document has moved here.
Apache/2.2.10 (Linux/SUSE) Server at 72.34.137.188 Port 7670

My users have to click on the "here" link to be redirected to http://myApp/index.rhtml.
Is there a way to use http://myApp without showing the redirection page first ?

Here's what I already tried:
  1. I added "index.rhtml" to the DirectoryIndex section of my apache2 httpd.conf file, but I still get the redirect page.
  2. I removed the Redirect$new('/index.rhtml') line from my Builder call, but that leads to the following error:
Error in app$call(env) : attempt to apply non-function

Here's the code I use to build my application:

url.root = "/testserver/htdocs"

myApp <-Builder$new(
  Static$new(
    urls = c('/css','/img','/js'),
    root = url.root
  ),
  Static$new(urls='/results',
             root=tempdir()
  ),
  Brewery$new(
    url='/',
    root=url.root,
    resultpath=tempdir()
  ),
  Redirect$new('/index.rhtml')
)

Thanks a lot for any help,
Thomas

Jeffrey

unread,
Jan 10, 2013, 1:44:26 PM1/10/13
to rr...@googlegroups.com
Hi Thomas,

I've upgraded both Rook and rApache to fix this issue. The new version of rApache is 1.2.2. I presume you know how to upgrade.

To upgrade Rook to 1.0-9, which is not on CRAN yet, use the devtools package and issue:

install_github('Rook','jeffreyhorner')

while you are the root user, as you want rApache to see that upgraded package as well.

Hope this fixes it.

Oh , and you definitely want the Redirect line.

Jeff

Thomas Sandmann

unread,
Jan 10, 2013, 6:43:46 PM1/10/13
to rr...@googlegroups.com
Hi Jeff,

great, now everything works as expected.

Thanks a lot !
Thomas
Reply all
Reply to author
Forward
0 new messages