Reference | tutorials
ASP Tutorial: Urlrewrite using reference documentation
What is Urlrewrite?
Urlrewrite is a technique for converting static pages into dynamic pages. For example, your site page is http://www.yourdomain.com/news/docread.aspx?id=123 using urlrewrite conversion to http://www.yourdomain.com/news/ 123.html to access.
The use of Urlrewrite: to meet the requirements of search engines, Google can crawl dynamic pages, but Google's dynamic page rating is generally lower than the static page.
Urlrewrite has different settings for the IIS server and the Apache server. The two configuration methods are different. Please pay attention to the vast number of users.
Apache Server settings: You need to create a. htaccess file in the site root. Write rules.
IIS Server settings: You need to create a Httpd.ini configuration file in the site root and write rules.
Because the Httpd.ini and Apache. htaccess files under IIS are two completely different configurations. Two cannot be used interchangeably. Writing Urlrewrite requires a professional technician.
How do I set the Urlrewrite for the IIS server's Web site?
Note Using Urlrewrite cannot open a Web site custom 404 error, otherwise urlrewrite will not work properly
Isapi_rewrite uses regular expressions to represent the substitution rules.
You need to create a Httpd.ini configuration file in your site root directory with Urlrewrite configuration information.
Here's what httpd.ini.
#-----------------Httpd.ini file content, you can copy it and upload it to your site's root directory-----------
[Isapi_rewrite]
# 3600 = 1 hour set cache time 1 hours
Cacheclockrate 3600
# Sets the number of regular expression substitution variables.
Repeatlimit 32
# Protect Httpd.ini and httpd.parse.errors files from accessing through HTTP
# The following urlrewrite rules are downloaded to avoid configuration files such as Httpd.ini httpd.errors the site.
Rewriterule ^/httpd (?: \. ini|\.parse\.errors). * [F,i,o]
# formal Urlrewrite rules, meaning that http://server/123.html will be accessing dynamic pages http://server/urlrwtest.asp?id=123
# You need to make changes to your site
Rewriterule/([0-9]*). html/urlrwtest.asp\?id=$1
#-----------------The end of the Httpd.ini file-----------
Urlrwtest.asp File Example:
<%response.write "Urlrewrite test: The ID number you accessed is:" & Request ("id")%>
The file is saved before it can be entered into effect.
Urlrewrite supports various scripts such as asp,asp.net,php.
Urlrewrite Common Errors
1.404 error (Page not found): No web site root created Httpd.ini file or regular expression error, will cause the page can not find errors
2.500 error (scripting error): Target Dynamic page program error
3.404 user-defined error: If the site administrator has turned on 404 Web site customization errors, Urlrewrite will not work correctly.