Asp programs can implement pseudo-static methods

Source: Internet
Author: User

Installation instructions:

1. Add the filter on the Isapi of IIS. The filter name is re. Select Rewrite. dll as the executable file;
2. Set the httpd. ini file

RewriteRule/news/(\ d +) \. html/jsp/news \. jsp \? Id = $1 [N, I]
Indicates that news. jsp? Id = 95 to news/95.html

Similarly, if you have more parameters, add the corresponding (\ d +), and add id = $2 if id = $1.

Currently, more common dynamic web pages include asp, php, jsp, shtml, jhtml, cgi ...... there are even some defined items, such as aspx, do, index, and hello. Format: news. asp? Id = 95. We recommend that you use re_write to convert it to news/95.html, so that google can identify the modified webpage.

Re_write is a module in iis. You can download it from http://www.zzcoo.com/re_write.zip with related installation instructions.

When you need to change news. jsp? When id = 95 is mapped to news/95.html, you only need to set the httpd. ini file:
RewriteRule/news/(\ d +) \. html/news \. jsp \? Id = $1 [N, I]
In this way, requests such as/news/95.html are mapped to/news. jsp? Id = 95

Then you write <a href = '/news/95.html'> 95 news </a> at the connection.
If your news is read cyclically through the database, the statement is as follows:
While (rs. next ())
{
String id = (String) rs. getString ('id ');
Out. print ('<a hef ='/news/'{id}'.html> ');
Out. print ('95 News ');
Out. print ('</a> ');
}

If you are processing data paging, the statement is as follows:

More _ <% = Page % >_< % = type %>. html (Note: page is the Page turning page and type is the data type)
Format: more_000095.html

If the next page is turned over, it is: More_2_95.html. To continue the next page loop, it is:
More_3_95.html, and so on.

However, you need to add the following code to the httpd. ini file:
RewriteRule/More _ (\ d +) \. html/jsp/more \. jsp \? Page = $1 & type = $2 [N, I]

If your dynamic program has multiple parameters to be passed, add multiple parameters (\ d +) as follows:

RewriteRule/More _ (\ d +) \. html/jsp/more \. jsp \? Page = $1 & type = $2 & type2 = $3 [N, I]

The page turning format is: more_rj95.html

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.