Showing posts with label ASP. Show all posts
Showing posts with label ASP. Show all posts

Friday, February 06, 2009

How to do redirect page

How to do redirect page?

PHP
<?php
header("Location: http:/harithdawi.com/");
exit();
?>

ASP
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://harithdawi.com/"
%>

ASP.NET
<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://harithdawi.com/");
}
</script>

JAVA (JSP)

<%
response.setStatus(301);
response.setHeader( "Location", "
http://harithdawi.com/" );
response.setHeader( "Connection", "close" );
%>

.HTACCESS (redirect all from old domain to  new domain)

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://harithdawi.com/$1 [R=301,L]

JAVA SCRIPT
<script type="text/javascript">
<!--
window.location = "http://harithdawi.com/"
//-->
</script>