Thursday, January 23, 2014

Page redirection using several scripts

While we do programming we are facing issues with redirecting pages. We can redirect the pages using several methods, 

Normally we face issues when a page moved to new domain, 

Using  javascript

window.location.href="http://www.yoururl.com"; 
or:
window.location = "http://www.yoururl.com";
or:
window.navigate("http://www.yoururl.com"); //works only with IE

PHP header redirect
header('Location: http://www.yoururl.com/');
exit;

Classic ASP
Response.Redirect "http://www.yoururl.com"

ASP.Net
Response.Redirect("http://www.yoururl.com");
or:
Response.Redirect("http://www.yoururl.com", false);

JSP
response.sendRedirect("http://www.yoururl.com");


Ruby
redirect_to "http://www.rubyonrails.org"

I will update soon with more useful javascript.

No comments:

Post a Comment