I am trying to redirect in the file /subdir/subdir/some.cgi
which calls the following method:
$self->redirect_to("/anothersubdir/some.html");
However, the above call will redirect to /subdir/subdir/some.cgi/anothersubdir/some.html
instead. So how do I really make it redirect to /anothersubdir/some.html
?
Apparently you must provide an absolute path to
redirect_to
.Why ? Because redirect_to says ...same arguments as url_for, which generates that url unless it is absolute. The docs aren't too explicit, but the source is.
So you could construct a new Mojo::URL object and give it to
redirect_to
:Or copy
redirect_to
and modify it to not useurl_for