Domain Mapping login does not redirect properly

When I try to log in with, it doesn't seem to redirect properly. The URL changes to

However, if I log in from, then it redirects properly, i.e., to

In the Settings page, the domain used for the administration area is set to the domain entered by the user.