0

I want to redirecting html page to another html page. In my code its getting redirecting. When it gets redirect the original html page should get close and it should not ask for warning like allow blocked content in redirected html.

  • 2
    depends on timing. do you want to not show the current page and redirect? do you want to redirect after a user does something? etc. – kennypu Apr 21 '14 at 05:05
  • Yes. I dont want to show the original html page and it should redirect to another html pae and it should not ask for the blocked content warning in redirected html page. – user3539701 Apr 21 '14 at 05:07

1 Answers1

1

easiest way would be to use javascript:

window.location.href ='http://google.com'; //link to redirect to

just stick that in the <head></head> or body.

The best/correct way to redirect would be via server. Whether its using htaccess or PHP, it is better to redirect before the user loads the page. in PHP, it would be something like:

<?php 
header("Location:http://google.com");
exit; //make sure nothing gets loaded after
kennypu
  • 5,950
  • 2
  • 22
  • 28