Below are methods to do redirection as soon as the page gets the visit using HTML Meta tag, ASP.NET and Javascript.
The most preferred way is ASP.NET than HTML Meta tag and Javascript as it is the most compatible option.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script language="C#" runat="server"> | |
// ASP.net permanent URL redirect | |
private void Page_Load(object sender, System.EventArgs e) | |
{ | |
Response.Status = "301 Moved Permanently"; | |
Response.AddHeader("Location","http://yahoo.com"); | |
Response.End(); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<!-- HTML meta URL redirect --> | |
<meta http-equiv="refresh" content="0; url=http://yahoo.com"> | |
</head> | |
<body> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<script type="text/javascript"> | |
// Javascript URL redirection - generated by www.rapidtables.com | |
window.location.replace("http://yahoo.com"); | |
</script> | |
</body> | |
</html> |