Easyasp v2.2 New Function Introduction (2): Implement pseudo URL with easp Rewrite

Source: Internet
Author: User
Tags expression implement regular expression sql injection

The previous log describes how easyasp v2.2 is implemented to prevent SQL injection, it seems that many people still use the ASP for this era to sneer at the attitude. Here or to persuade, if you think that the ASP is the last century things already outdated, why come in to let oneself afflictive, thank you. Easyasp only in the humble attitude to the final asper to provide a new way to solve the problem, I also believe that the use of ASP's people have their own evaluation of easp.

No nonsense, this one goes on to introduce another new feature of easp v2.2: Pseudo URL Rewrite.

1. Why is it called pseudo URL Rewrite?

The name sounds very awkward, but let me explain it first.

For example, if we open any article on the homepage of the blog, we can see its address like this:

Http://www.cnblogs.com/zhuqil/archive/2010/01/15/1648321.html

This we know is generating a static page. But some sites do not take the way to generate static pages, but using the URL rewrite technology, showing the static page address, in fact, the server side with regular expressions of the page parameters are mapped, such as the following:

页面地址:
http://www.ambox.cn/design-2010-4.html
对应的Rewrite规则:
RewriteRule /(design|stuff)-(\d+)-(\d+)\.html /? type=$1&year=$2&page=$3 

This approach is also commonly referred to as pseudo static. And easyasp realize, just use ASP imitate this pseudo static, should be called pseudo pseudo static, it is not good to hear, so I simply call it pseudo rewrite. This pseudo-rewrite is represented by this URL:

Http://www.ambox.cn/?design-2010-4.html

What is the difference between the address and the static page? Just one more? Number, indicating that it is just a URL parameter to imitate the static page address, the fact that this way has proved that the SEO has a certain help, such as the business blog to do a better Chinese wisdom net, using this kind of pseudo-rewrite.

Pseudo-rewrite of 2.EasyASP

In Easp v2.2, it is easy to implement pseudo rewrite, or to first list the method syntax and parameter descriptions:

Easp.rewriterule rule, URLs set easyasp URL pseudo static rules in standard mode

Parameter name Type Description
Rule String Address with regular expression rule, must begin with "/" or "^/"
Url String URL address to map, must begin with "/"

Easp.rewrite urlpage, rule, Urlparam set easyasp URL pseudo-static rules in advanced mode

Parameter name Type Description
Urlpage String Pages rewritten with URLs, where multiple pages are separated by a "|" symbol, or the current page if left blank
Rule String An overridden address with a regular expression rule that does not contain a directory structure
Urlparam String URL parameters to map

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.