If I visit
http://mercado.softwarepublico.gov.br/register/
The form HTML looks like:
form class="margin-form" style="margin: 0px;" action="/register/" method="post" name="login"
Which looks correct. The post goes to the same URL. There should not be any redirects occuring. That is there should not be an external browser redirects. It should map the URL internally.
If I visit
http://teste.softwarepublico.gov.br/mpv/register/
the form HTML looks like
form class="margin-form" style="margin: 0px;" action="/mpv/register/" method="post" name="login"
I think I'll review your patch again and see if can understand what the request processor does in this case.