Asp.Net 301Öض¨ÏòµÄʵÏÖ(SEOÓѺã¬ÓÐÀûÓÚPRÖµ)
ÍøÕ¾µÄÖض¨Ïò£¬Í¨³£ÓõÄÓÐ 301 ºÍ 302£¬301ÊÇÓÀ¾ÃÖض¨Ïò£¬ÊǶÔSEOÓѺõģ¬ÓÐÀûÓÚ±£³ÖÔÓòÃûºÍÐÂÓòÃûÖ®¼äµÄPRתÒƼ°Á÷Á¿Êý¾ÝµÈ¡£
Asp.Net ÖÐʵÏÖ301Öض¨ÏòµÄ´úÂ룬ҲÊDZȽϼòµ¥µÄ£¬¾Ù¸öÀý×Ó£º
ÔÀ´µÄÓòÃûÊÇ www.abc.com, ÏÖÔÚÒª½«¶ÔÕâ¸öÓòÃûµÄ·ÃÎÊ£¬È«²¿Öض¨Ïòµ½ www.zu14.cn;
Ö»ÐèÔÚ ÐèҪתÏòµÄÒ³ÃæÀ
protected void Page_Load(object sender, EventArgs e)
{
Response.Clear();
Response.StatusCode = 301;
Response.Status = "301 Moved Permanently";
Response.AddHeader("Location","http://www.zu14.cn}");
=================================================
³£ÓõÄÖض¨Ïò·½Ê½ÓÐ: 301 redirect, 302 redirect Óë meta fresh£º301 redirect: 301´ú±íÓÀ¾ÃÐÔתÒÆ(Permanently Moved)£¬301Öض¨ÏòÊÇÍøÒ³¸ü¸ÄµØÖ·ºó¶ÔËÑË÷ÒýÇæÓѺõÄ×îºÃ·½·¨£¬Ö»Òª²»ÊÇÔÝʱ°áÒƵÄÇé¿ö,¶¼½¨ÒéʹÓÃ301À´×öתַ¡£
302 redirect: 302´ú±íÔÝʱÐÔתÒÆ(Temporarily Moved )£¬ÔÚǰЩÄ꣬²»ÉÙBlack Hat SEOÔø¹ã·ºÓ¦ÓÃÕâÏî¼¼Êõ×÷±×£¬Ä¿Ç°£¬¸÷´óÖ÷ÒªËÑË÷ÒýÇæ¾ù¼ÓÇ¿ÁË´ò»÷Á¦¶È£¬ÏóGoogleǰЩÄê¶ÔBusiness.comÒÔ¼°½üÀ´¶ÔBMWµÂ¹úÍøÕ¾µÄ³Í·£¡£¼´Ê¹ÍøÕ¾¿Í¹ÛÉϲ»ÊÇspam£¬Ò²ºÜÈÝÒ×±»ËÑÑ°ÒýÇæÈÝÒ×ÎóÅÐΪspam¶øÔâµ½³Í·£¡£
meta fresh: ÕâÔÚ2000ÄêÇ°±È½ÏÁ÷ÐУ¬²»¹ýÏÖÔÚÒѺÜÉÙ¼û¡£Æä¾ßÌåÊÇͨ¹ýÍøÒ³ÖеÄmetaÖ¸ÁÔÚÌض¨Ê±¼äºóÖض¨Ïòµ½ÐµÄÍøÒ³£¬Èç¹ûÑÓ³ÙµÄʱ¼äÌ«¶Ì(Ô¼5ÃëÖ®內)£¬»á±»ÅжÏΪspam¡£
301 RedirectʵÏÖÍøÒ³Öض¨Ïò
IIS·þÎñÆ÷ʵÏÖ301Öض¨Ïò
* ´ò¿ªinternetÐÅÏ¢·þÎñ¹ÜÀíÆ÷£¬ÔÚÓûÖض¨ÏòµÄÍøÒ³»òĿ¼ÉÏ°´ÓÒ¼ü
* Ñ¡Ôñ“Öض¨Ïòµ½URL”
* ÔÚ“Öض¨Ïòµ½”ÊäÈë¿òÖÐÊäÈëÒªÌøתµ½µÄÄ¿±êÍøÒ³µÄURLµØÖ·
* Ñ¡ÖГ×ÊÔ´µÄÓÀ¾ÃÖض¨Ïò”£¨Çмǣ©
* ×îºóµã»÷“Ó¦ÓÔ
Apache·þÎñÆ÷ʵÏÖ301Öض¨Ïò
Ïà±È½ÏÀ´Ëµ£¬ApacheʵÏÖÆðÀ´Òª±ÈIIS¼òµ¥¶àÁË¡£ÔÚApacheÖУ¬ÓиöºÜÖØÒªµÄÎļþ.htaccess£¬Í¨¹ý¶ÔËüµÄÉèÖ㬿ÉÒÔʵÏֺܶàÇ¿´óµÄ¹¦ÄÜ£¬301Öض¨ÏòÖ»ÊÇÆäÖÐÖ®Ò»¡£
Redirect permanent / http://www.bloghuman.com/ (½«Ä¿Â¼ÏÂÄÚÈÝÖض¨Ïòµ½http://www.bloghuman.com/)
redirect permanent /index.php http://www.bloghuman.com/index.php?go=category_6(½«ÍøÒ³index.phpÖض¨Ïòµ½http://www.bloghuman.com/index.php?go=category_6)
ͨ¹ýºÏÀíµØÅäÖÃÖض¨Ïò²ÎÊýÖеÄÕýÔò±í´ïʽ£¬¿ÉÒÔʵÏÖ¸ü¸´ÔÓµÄÆ¥Åä¡£ÓÐÐËȤµÄÅóÓѿɲο
Ïà¹ØÎĵµ£º
µÚÒ»£º
C# code
private void Button1_Click( object sender, System.EventArgs e )
{
Response.Redirect( Request.Url.ToString( ) );
}
µÚ¶þ£º
C# code
private void Button2_Click( object sender, System.EventArgs e )
{
Response.Write( " < script language=javascript>window.location.h ......
JQueryϵÄUI¿Ø¼þËƺõÊÇÓÐÎÊÌâµÄ£¬Ä³ÌìÎÒ´ÓÁ賿Á½µãµ÷ÊÔÒ»¸öJQuery Dialog£¬Ò»Ö±µ½ÔçÉÏ8£º00¶¼Ã»Óе÷ÊÔ³öÀ´¡£µ±Ê±ÎÒÔÚDialogÀïÃæ·ÅÖÃÁËÒ»¸ö·þÎñÆ÷°´Å¥£¬²¢Èð´Å¥ºÍCodeBehindÀïµÄÒ»¸öʼþ´¦Àíº¯Êý°ó¶¨£¬µ«ÊÇÆæ¹ÖµÄÊÇÔõôµã»÷°´Å¥£¬¶¼²»ÏìÓ¦ºóÃæµÄʼþº¯Êý£¬ÕûµÃÎÒÖ±×¥¿ñ¡£
ÌìÁÁºó£¬GoogleÁËһϣ¬ÖÕÓÚÕÒµ½ÔÒò£ºJQuery»á°Ñ ......
ÔÚÔçÆÚѧϰc#µÄ¹ý³ÌÖУ¬¾³£Óöµ½ÕâÑùµÄÓï¾ä£º
public string StudentName
{
get{return stuName;}
set{stuName=value;}
}
µ±Ê±Ò²²»ÊǺÜÃ÷°×ΪʲôҪÕâÑù£¿Ñ§ÉîÁËc#ºó£ ......
¿Í»§¶ËÑéÖ¤·½Ê½£º
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
&nbs ......