301 Weiterleitung PHP ASP.net Coldfusion

In fast jeder Skriptsprache gibt es eine Möglichkeit eine 301 Weiterleitung (Redirect) einzurichten. Dies ist für eine Suchmaschinenfreundliche Weiterleitung wichtig (SEO).

301 Redirect in PHP
<?php
Header( “HTTP/1.1 301 Moved Permanently” );
Header( “Location: http://www.neueOderAlteDomain.de/neuerPfad” );
?>

301 Redirect in ColdFusion
<cfheader statuscode=”301″ statustext=”Moved permanently”>
<cfheader name=”Location” value=”http://www.neueOderAlteDomain.de/neuerPfad”>

301 Redirect in ASP
<%@ Language=VBScript %>
<%
Response.Status=”301 Moved Permanently”
Response.AddHeader “Location”, “http://www.neueOderAlteDomain.de/neuerPfad”
>

301 Redirect in ASP .NET

<script runat=”server”>
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = “301 Moved Permanently”;
Response.AddHeader(“Location”,”http://www.neueOderAlteDomain.de/neuerPfad”);
}
</script>

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert