301 Usage and Error explanations

Source: Internet
Author: User
    1. Options +followsymlinks
    2. Rewriteengine on
    3. Rewritecond%{http_host} ^domain.com [NC]
    4. Rewriterule ^ (. *) $ http://www.domain.com/$1 [l,r=301]
Copy Code

If you are using a Windows host, you should do 301 steering settings in the Control Panel. Editor's recommendation: php pseudo static URL rewrite rewrite rule introduction php URL rewrite path rewrite example

Add: Answer the question of Stone King in the website normalization comment, may be helpful to everybody:

As far as I know, html can't do 301 turns. You can only do JS or meta REFRESH in HTML, but not 301 turns. Once the HTML has been read, it has returned a status code of OK.

If your page is ASP or PHP can also do 301 turn: asp:

    1. <%@ Language=vbscript%>
    2. <%
    3. response.status= "301 Moved Permanently" Response.AddHeader "location", "http://www.domain.com"
    4. >
Copy Code

Php:

    1. Header ("http/1.1 301 Moved permanently");
    2. Header ("location:http://www.domain.com");
    3. ?>
Copy Code

In addition, the Dothtaccess file is just an ordinary text file, you use Notepad to build this file, put the instructions, exist in your account root directory on the line. No need to modify Apache.

Q: How long will the search engine handle the web after 301 redirects?

Web page with 301 redirect after the original search engine contains the old domain name of the pages will be forwarded to the new domain. Search engine contains the old domain name of the page will change, such as site:www.xxx.com after the old domain name will be transferred to the new domain, how long.

A: If your old URL is using HTTP 301 (permanent) redirection to your new website, the search engine automatically learns the new URL when roaming and automatically updates it within 6-8 weeks.

301 redirects to boost search engine optimization results

From the perspective of SEO, 301 redirection is the most feasible way to redirect URLs. When the domain name of the site changes, the search engine will only index the new URLs, but also the old address under the original external links to the new address, so that the site will not be ranked because of the change in the slightest impact. Similarly, when you use the 301 Permanent redirect command to point multiple domain names to the site's home domain, there is no negative impact on the site's ranking.

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.