Redirection to another host with the same URI

Dear Dev Team,

I m looking to redirect the URL as below.

From

http://test.com/home-page/register-user\*

To

http://www.test.com/home-page/register-user\*

Could you pls someone suggest an iRule?

Best Regards,

when HTTP_REQUEST {
    if { [string tolower [HTTP::host]] equals "test.com" } {
        HTTP::redirect "http://www.test.com[HTTP::uri]"
    }
}