zoukankan      html  css  js  c++  java
  • SEO之如何做301转向

    1、如果网站使用的是(Linux+Apache+MySQL+PHP)主机,可以使用.htaccess文件做301转向

    比如把/index.html 301转向到http://www.xinlvtian.com,可以在.htaccess文件中放上这个指令

    Redirect 301 /index.html http://www.xinlvtian.com

    把所有不带www(http://xinlvtian.com)网址301转到带www的网址,包括把http://xinlvtian.com/about.html转到http://www.xinlvtian.com/about.html

    2、如果用的是Windows主机

    Asp代码:
    <% @ language=vbscript %>
    <% Response .status =”301 moved permanently” response.addheader “location”,”http:www.xinlvtian.com” >

    php代码:

    Header(“http/1.1 301 moved permanently”);
    Hrader(“location:http://www.xinlvtian.com”);
    ?>

  • 相关阅读:
    隔离级别
    cookie
    session
    正则表达式
    hello2源代码解析
    servlet_filter简介
    web.xml
    Annotations
    Java design patterna
    CDI Features
  • 原文地址:https://www.cnblogs.com/xinlvtian/p/8945564.html
Copyright © 2011-2022 走看看