1. First, let's talk about how to redirect IIS 301:
Open "Internet information service", right-click the folder or file you want to jump to, and choose "properties" from the context menu, under the "directory" option, find "connect to resource is the content source", select "redirect to URL", enter the page to jump to in the text box below, select the "client will be directed to" check box "permanent redirection of resources" under ", and click" application ".
2. Use the code to perform 301 redirection:
1. 301 redirection in PHP:
<? Php Tutorial Header ("HTTP/1.1 301 Moved Permanently "); Header ("Location: http://www.mydomain.com "); ?> |
2. 301 redirection under ASP:
<% @ Language = VBScript %> <% Response. Status = "301 Moved Permanently" Response. AddHeader "Location", "http://www.mydomain.com" %> |
3. Redirection of 301 in ASP. NET:
<Script runat = "server"> Private void Page_Load (object sender, System. EventArgs e) { Response. Status = "301 Moved Permanently "; Response. AddHeader ("Location", "http://www.mydomain.com /"); } </Script> |
301 redirection in ColdFusion:
<. Cfheader statuscode = "301" statustext = "Moved permanently"> <. Cfheader name = "Location" value = "http://www.mydomain.com/"> |
All of the above methods can be redirected to a.com and B .com. However, the problem occurs when the code cannot implement callback. If the domain name we want to redirect contains a large amount of content indexed by Baidu and has a certain ranking in the search engine tutorial, I suggest you use IIS 301 redirection, in this way, the weight of the website can be transmitted without causing traffic loss. Code can also be used to redirect new domain names to old ones without much traffic.