Pure static page How do 301 redirect

Source: Internet
Author: User

Intermediary transaction http://www.aliyun.com/zixun/aggregation/6858.html ">seo diagnose Taobao guest cloud host technology Hall

Yesterday met a thorny problem, that is, the page is purely static, the space is IIS, space merchants do not let the configuration, how to do? First of all, I am a novice, write down my experience of the day.

Code first and then explain.

<%@ language=vbscript% >

<%

If left (request. ServerVariables ("Http_host"), 4 <> "www." Then

url = "http://www." &request. ServerVariables ("Http_host") & Request.ServerVariables ("Script_name")

If Request.ServerVariables ("Query_string") <> "" Then url = URL & "?" & Request.ServerVariables ("Query_stri NG ")

Response.Status = "Moved Permanently"

Response.AddHeader "Location", url

End If

% >

1, for the pure ASP to write the site, this paragraph directly copied to the Conn,asp page can be, or on the homepage may also be written in the entire document before, this casually said, very simple.

2, pure HTML, this is more trouble is my problem today, search some solutions are to change the server configuration, service providers and no discussion, so only their own way. First, the HTML file does not support ASP, for some people say those html inside directly jump and what JS and so on, the code does not stick, certainly not because this is the client language.

3, now only modify their own problems, or you can not solve the problem, the first thought of the method is to build a index.asp file, because he is higher priority than the HTML, do 301 and then jump to index.html. This is solved, but new problems arise. Each time you open a index.html instead of a domain name.

4, now only to change the home page to ASP, I was so resolved. Then the specific how to do: Generate static page There must be a template folder, find Templates folder, the inside index.html into index.asp to copy the above code. Then find the place to generate the home page, should be in the background, the filename should be listindex.asp and so on, the inside of all the index.html changed to Index.asp, return the address of the home page all with < a href= "/" > Home </A >.

4, finished the test, to see whether the return value is 301, I detected is right. Just don't know the pure static ASP for search engine and HTML and what difference.

This article by the Japanese Railway travel voucher Webmaster Pure original, reprint please keep the link

Related Article

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.