Only RewriteLocalhost when not TLD. Fixes #965
Merge pull request #967 from jhovgaard/master

Fixes bug when creating Selfhost with URI including "localhost" in domain name.