| 301 redirect htacess seo - הפניית 301 דפים נכונה לשמירה על דירוג לאתר |
|
איך להפנות דפים קיימים לדף חדש מבלי לאבד
את המיקום במנועי חיפ7וש ? הפנייה רגילה אינה משפיעה על הדרוג של הדף אלא מהווה קפיצה מדף קיים לדף אחר. כדי לבצע הפניה מלאה אשר מצהירה על עדכון דף יש להמנע מהקוד המקובל. ההפניה הרגילה ב- PHP
<?
header('Location: http://www.yoursite.com/new_page.html');
?>
או ההפניה ה ASP
<%
Response.Redirect ("http://www.yoursite.com/new_page.html")
%>
על שרתי לינוקס אפשר להגדיר באופן גורף הפניה גורפת
מתוך הקובץ הגדרות .htaccessRedirect 301 / http://www.to-new-site.com/והאופן פרטני יותר Redirect 301 /myoldpage.html http://www.mynewyoursite.com/newpage.html Redirect 301 /myoldpage2.html http://www.mynewyoursite.com/folder/ב - ASP <% Response.Status = "301 Moved Permanently" Response.AddHeader "Location", "http://http://tymond.net/" Response.End %>JSP (Jscript) Redirect <% response.setStatus(301); response.setHeader( "Location", "http://picture-previewer.com/" ); response.setHeader( "Connection", "close" ); %>ASP .NET Redirect
private void Page_Load(object sender, System.EventArgs e)
{
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://picture-previewer.com/");
}
CGI PERL Redirect
$q = new CGI;
print $q->redirect("http://www.new-url.com/");
Ruby on Rails Redirect
def old_action headers["Status"] = "301 Moved Permanently" redirect_to "http://www.new-url.com/" end |