301 URL Redirect

301 redirect adalah sebuah metode untuk memindahkan halaman web ke halaman yang lain maupun ke domain lain. Kode “301” diartikan sebagai “dipindahkan secara permanen”.

ColdFusion Redirect
<.cfheader statuscode=”301″ statustext=”Moved permanently”>
<.cfheader name=”Location” value=”http://www.new-url.com”&gt;

PHP Redirect
<?
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.new-url.com&#8221; );
?>

ASP Redirect
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”,”http://www.new-url.com/&#8221;
%>

ASP .NET Redirect
<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”,”http://www.new-url.com&#8221;);
}
</script>

JSP (Java) Redirect
<%
response.setStatus(301);
response.setHeader( “Location”, “http://www.new-url.com/&#8221; );
response.setHeader( “Connection”, “close” );
%>

CGI PERL Redirect
$q = new CGI;
print $q->redirect(“http://www.new-url.com/&#8221;);

Ruby on Rails Redirect
def old_action
headers[“Status”] = “301 Moved Permanently”
redirect_to “http://www.new-url.com/&#8221;
end

.htaccess redirect
redirect ke domain lain
Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]

redirect ke www
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^domain.com [nc]
rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]

Advertisements

Web Hosting Murah | Shared Hosting Murah | Registrasi Domain Murah

my tweet

Badge

blog-indonesia.com

RSS my tumblr

  • An error has occurred; the feed is probably down. Try again later.

instagram

There was an error retrieving images from Instagram. An attempt will be remade in a few minutes.

Blog Stats

  • 91,855 hits

%d bloggers like this: