How to Redirect a Web Page

รวม web scripts ในการ redirect url หลายรูปแบบ เลือกใช้ได้ตามความเหมาะสม

PHP Redirect

<?
header( "Location: http://www.new-url.com" );
?>

Meta Refresh URL Redirect

<meta http-equiv="refresh" content="5;url=http://www.new-url.com" />

Javascrip URL Redirect

<script type="text/javascript">document.location.href='www.new-url.com'</script>

หรือ
<script type="text/javascript">
<!--
window.location = "http://www.new-url.com/"
//-->
</script>

ASP Redirect

<%@ Language=VBScript %>
<%
Response.AddHeader "Location","http://www.new-url.com/"
%>

ASP .NET Redirect

<script runat="server">
private void Page_Load(object sender, System.EventArgs e)
{
Response.AddHeader("Location","http://www.new-url.com");
}
</script>

JSP (Java) Redirect

<%
response.setHeader( "Location", "http://www.new-url.com/" );
response.setHeader( "Connection", "close" );
%>

CGI PERL Redirect

$q = new CGI;
print $q->redirect("http://www.new-url.com/");

Ruby on Rails Redirect

def old_action
redirect_to "http://www.new-url.com/"
end

ColdFusion Redirect

<.cfheader name="Location" value="http://www.new-url.com">

shtml URL Redirect

<!--#include virtual="http://www.new-url.ca/index.html"-->

htaccess (Apache) Redirect

redirect /old_dir/ http://www.new-url.com/new_dir/

URL redirection [Wikipedia]

Comments

celine bags's picture

Re: How to Redirect a Web Page

Maddeningly, Celine bags tends not to show many of its bags on the runway. We get a little glimpse here and there of where Phoebe Philo's brilliance is headed for the season with celine luggage bags. Fashion Celine handbags here with red sole shoes and red bottoms. The London Louboutin shoe for women online 2012. Pick your owm style of red bottom heels. The feel of sexy red bottom shoes can connect with your body.

Post new comment

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.