Use ISAPI_Rewrite to enable IIS to support URL rewriting for. htaccess under Apache.

Source: Internet
Author: User

A few days ago, I used Linux as a server to write something and found that. htaccess under Apache is really a good thing! Not only can the URL be truly overwritten, but also false rewriting can be implemented. Real rewriting can effectively reduce the code volume and server resource consumption. pseudo rewriting can effectively reduce the server's static file volume and save space! In fact, the htaccess function is far more than that.

Now, can we implement the exciting features of htaccess in IIS? ASP. NET2.0 is not a server-level task and cannot be used to rewrite the task. Therefore, it is only necessary to submit the task to ISAPI and search for it online. A company (organization) has developed such a task! Incredible!

Official Address: http://www.isapirewrite.com/

The downloaded file Rewrite. dll is our ISAPI. Add this dll in IIS and restart it !!! Fantastic !!!

Httpd. ini is equivalent to. htaccess!

The current version is version 2.9. For more information about the technical documentation, see the Chinese manual in English (which is better written in English. It is recommended that you read the English document)

I will not talk much about how to use it. Manual

The following is a simple example:

1. httpd. ini

[ISAPI_Rewrite]
RewriteRule ^ (. *)/([a-z0-9 \-] + \. html) $1/default2.asp \? Filename = $2

2. default2.asp

<% = Request. QueryString %>

3. Enter "http: // localhost/abcd123456.html" in the browser and you will see that the webpage is displayed, but this page is not generated in the background!

Filename=abcd123456.html

This technology is the URL pseudo rewrite technology applied by WordPress. If IIS itself supports this technology, it is estimated that Z-Blog will integrate this technology.

Where can reconstruction be needed when the technology Z-BLOG is applied? You only need to change httpd. ini.

In short, ISAPI_Rewrite and htaccess are both technologies worth learning and mastering, especially htaccess. We should try our best to apply it and discover its potential.

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.