ASP does not need system component to implement pseudo static

Source: Internet
Author: User

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

I've got a free movie station recently. Ready to implement pseudo static. Because the server is not its own can not use the component. As long as it is written for a friend who uses a virtual host, does he have a server or a direct component?

On the internet to find a lot of pity is CTRL + C CTRL + V. The look is not quite clear.

This time I'll talk about it.

Like http://www.xuniwangluo.com/dy/play?action=cc&id=4003 to be converted to

Http://www.xuniwangluo.com/dy/play/?cc-4003.html this form of pseudo static

Then create a play directory in the play.asp directory.

And then copy the play.asp to the play directory renamed to Index.asp "Use of Windows does not allow directory vulnerabilities

Then insert the following code into the head of the index.asp code

Dim idc,id1,id2,id,action

Idc=request.servervariables ("Query_string")

Id1=replace (IDC, ". html", "")

Id2=split (ID1, "-")

Action=id2 (0)

Id=id2 (1)

Principle:

Dim idc,id1,id2,id,action ' Declare variable (you can change the ID action two parameters to the parameters you need)

Idc=request.servervariables ("Query_string") ' (intercept) the address at the back. such as http://www.xuniwangluo.com/dy/play/?cc-4003.html

Then IDC equals cc-4003.html.

Id1=replace (IDC, ". html", "") "(Id1 means to split IDC and. html so id1 is equal to cc-4003

Id2=split (ID1, "-") "(Id2 is the"-"as the center of the split Id1 Id2 is equal to CC 40,032 part

Action=id2 (0) ' (Action equals the first "-") the previous argument is CC

Id=id2 (1) ' (ID is equal to the first "-" parameter is 4003 (if you have the 3rd argument, you can write Canshu3=id (2)

Ok. In this case, the action ID two parameters can be read directly from the browser address and then passed to index.asp let index.asp read the data from the database and display the content

"-" can be modified to other parameters.

Then the address you visit should be http://www.xuniwangluo.com/play/?cc~4003.html.

It can also be modified by itself. HTML for other suffixes such as:. htm. php. shtml et cetera

This only provides an ASP pseudo static implementation. As for if all dynamic connection addresses are modified to pseudo static access. You need to modify the template of your website.

I hope this article is useful to everyone

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.