In short, feel the URL of the site has parameters is a very awkward thing, on the one hand is very 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:
To be aware of is the <LookFor></LookFor> and <SendTO></SendTO> node, the URL path written to the LookFor node is the externally advertised URL path. The URL path in the SendTo node is the true path that IIS returns when parsing. Part of a node in the above figure is just like the letter D, followed by the numbers. Newslistaspx with parameter return resolution , and the two parts of the node are as long as the letter DD followed by the newsdetails.aspx with the number of return processing, and node three is the HTML request page into ASPX request return.
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 iis-"Right click on Site-" properties-"switch to the Home Directory tab-" Click "Configure" button-"switch to" map "tab-" double click ". aspx, in the pop-up window, copy the string following executable file--click Add-" Enter a copy of the executable path---à remove "check file exists" checkbox, 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 ")%>" ><% #Eval ("Name")%></a>
Modified into
<a href= d<% #Eval ("ID")%>.html "><% #Eval (" Name ")%></a>
and put
<a href= "Newsdetails.aspx? newsid=<% #Eval ("ID")%> "><% #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