The difference between IIS 301 redirection and program code implementation 301 redirects _ Tips

Source: Internet
Author: User

Let's say the IIS 301 redirect approach:

301 redirect in IIS

Open Internet Information Services, right-click the folder or file you want to jump to, in the pop-up right-click menu, select Properties Pop-up dialog box, under the Table of Contents option to find "Connect to resource Content source", select "Redirect to URL", in the following text box, enter the page to jump to the same time, Click "Apply" to select "permanently redirect clients" to the checkbox below.

Use code to do 301 redirects:

301 redirects under 1.PHP

Header ("http/1.1 moved Permanently");
Header ("location:");

301 redirects under 2.ASP

<%@ Language=vbscript%>
Response.status= "Moved Permanently"
Response.AddHeader "Location", ""

3.ASP. NET, 301 redirects

<script runat= "Server" >
private void Page_Load (object sender, System.EventArgs e)
Response.Status = "Moved Permanently";
Response.AddHeader ("Location", "");

301 redirects under the ColdFusion

<.cfheader statuscode= "statustext=" "Moved Permanently" >
<.cfheader name= "Location" value= "" >

The following methods, I have tested, can be redirected, can be implemented, redirect to But ask to appear in the code cannot implement redirect to Index.html on the page. and doing 301 redirects via IIS can do this. If we need to redirect the domain name has a large number of content by Baidu included, and, in search engines have a certain ranking, I suggest that we all adopt IIS 301 redirect, that, can pass the weight of the site, will not cause traffic loss. And for those new domain name to the old domain name, the new domain name and not much traffic, you can also use code to achieve redirection.

There are not to do or need to do 301 redirect friends, can add me qq:798843023

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: 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.