A few days ago, in order to enhance the site's SEO, set about another domain name: www.kanshule.com under the 301 turn to www.jb51.net under the page.
Since the site currently has only one blog, so from the beginning of the blog.
The idea is very simple, get the current browsing page of the domain name, if you need to turn to the domain name, and then replace the domain name part, as a new address to 301 turn.
The code is as follows:
Copy Code code as follows:
<%
Dim Todomain,fromdomain,curdomain,q,p,url
Todomain=www.jb51.net
Fromdomain= "Kanshule.com"
Curdomain=request.servervariables ("Http_host")
If InStr (Curdomain,fromdomain) >0 Then
Q=request.servervariables ("Query_string")
P=request.servervariables ("URL")
Url= "http://" &toDomain&p& "furl=kanshule.com"?
If q<> "" Then url=url& "&" &q
Response.status= "Moved Permanently"
Response.AddHeader "Location", url
Response.End ()
End If
%>
Deliberately added a parameter to the URL to record how many accesses are accessed from this domain name.
Save this file as an ASP file that contains any of the ASP pages you want to jump to.
Blog, there are calls to the common database connection file conn.asp, I will include this file in Conn.asp, fix.