asp.net pseudo-Static Configuration memo _ Practical Tips

Source: Internet
Author: User
In short, feel the site's UrlIt is a very awkward thing to have parameters on the one hand, it is easy to inject, on the other hand, parameter transmission is very easy to divulge some useful information.

And this article is mainly aimed at the Web site URL display pseudo static, so abandoned the direct generation of static page of the trouble, and can be very good protection of user privacy, while the site security will also have a certain performance improvement.

The main operating procedures are as follows:

First of all, we need a Microsoft urlrewriter component, here's the download address I'll provide under:

http://download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/ Msdnurlrewriting.msi

Then you create a new Web site and Add the DLL file to your project by adding a reference.

I built the site page is a simple front-office press release system, the page is as follows:

And then there's the list page:

Then the above is titled "3333333" Detailed information display page, the specific display page is:

So for such a page, we have to do pseudo static, first of all, we need to configure webconfig

As shown in the following illustration:

One thing to be aware of is the<LookFor></LookFor>And<SendTO></SendTO>node, written toLookForIn the nodeUrlThe path is published externallyUrlPath, whileSendTOIn the node url path is Iis D Back with the numbers are handed to Newslistaspx With the parameter return resolution, and the node two part is as long as is similar to the letter DD Newsdetails.aspx with parameter return processing; and Node three is Html request page to Aspx request returned.

You also need to add the following modules below the <HttpHandlers> node :

These settings are good, but our IIS default is not able to directly parse the HTML suffix (if not added), then you need to configure IIS, the configuration path is as follows:

Open itiis-Right click on the website—"Property—"Switch to the Home Directory tab"-" click "Configure" button -" switch to the "Map" tab -" "Double click" . Aspx", in the pop-up window, copy the string after "executable" -" click "Add" -" Enter a copy of the executable path --- à remove " Check if the file exists "tick box, the last application can be."

After the configuration is complete, on your site, as long as there is similar

<a href = ' newslist.aspx?id=<% #Eval ( "id" "%> ' ><%#< Span lang= "en-us" Times New Roman '; mso-font-kerning:0pt; Mso-no-proof:yes ">eval ( Name) %> </ a ,

Modified into

<a href= d<% #Eval ("ID") %>. html ' ><%#Eval (' Name ') % ></a>

and put

<a href = ' newsdetails.aspx? newsid=<% #Eval ( "id " "%> ' ><%#< Span lang= "en-us" Times New Roman '; mso-font-kerning:0pt; Mso-no-proof:yes ">eval ( Title) %> </ a "

Modified into

<a href= ' dd<% #Eval (' ID ') %>. html ' ><%#Eval ("Title") %></a>

Finally , you can use IIS to access it, Setup is complete

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.