Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks! I am just new programming in mod_perl for Apache servers. I got a problem that i do not know how can I sort it out. could you help me ? when trying to acces http://www.test.com, i want to redirect to http://www.test.com/?view=test that's mean, changing the argumnets. can I do this ? sub handler { $r = shift; $r->args("$view=test"); $r->content_type('text/html'); $r->send_http_header; } it does not bring me http://www.test.com/?view=test. Any ideas ??? Thanx a lot!!

Replies are listed 'Best First'.
Re: mod perl for apache servers
by ChOas (Curate) on Dec 15, 2000 at 19:44 UTC
    Found this on http://perl.apache.org/guide/snippets:
    (Edited for your sittuation)
    my $r = shift; $r->headers_out(Location => 'http://www.test.com/?view=tes +t'); $r->status(REDIRECT); $r->send_http_header;

    Hope this helps... (come to think of it... hope it works ;))

    GreetZ!
      ChOas