Why are you making it all so difficult
<script>
window.location = 'http://example.com';
</script>
Redirected.Its not a bug, its a feature. What you should be worried about is what http://www.example.com can do, can it execute arbitrary code, post to facebook/twitter etc.?