Introduction to urlrewriter Resources

Source: Internet
Author: User

1. urlrewriter resources:
Http://download.microsoft.com/download/0/4/6/0463611e-a3f9-490d-a08c-877a83b797cf/MSDNURLRewriting.msi
Http://msdn.microsoft.com/zh-cn/library/ms972974.aspx
Http://blog.csdn.net/chenghp/archive/2007/04/10/1559212.aspx

2. urlrewriter second-level domain name implementation:
Http://www.cnblogs.com/jzywh/archive/2006/02/20/seconddomainurlrewriter.html
Http://www.cnblogs.com/jzywh/archive/2005/09/29/246650.html

3. Applicable IIS configurations:

After configuration, the status shown in the log is 200. IIS directly considers this file to exist,
Instead of 301, or 302, this may not be applicable in some cases, such as directory or file adjustment during search engine optimization.

By default, only redirection in. Net format is supported, such as. aspx format.
For example: show_12_yongfa365.aspx --> show. aspx? Id = 12 & name = yonga365

If you want to implement it, *. html format (we generally use this method to implement. Net pseudo-static)
For example: show_12_yongfa365.html --> show. aspx? Id = 12 & name = yonga365

You must add related "Applications" to the site.ProgramExtension"
Add method: Right-click the relevant site --> properties --> main directory --> Configuration --> ing -->
Find the record whose extension is. aspx, double-click the record, copy the content in the executable file, and close
Go back to the application configuration, click Add, paste the copied address, enter ". html" in the extension, and remove the check box "check whether the file exists.
OK. The configuration on IIS is ready.

4. Download related files:

Download the urlrewriter component from here. Install urlrewriter. dll in the installation directory to your project bin directory.

5. ConfigurationWeb. config:

In<Configuration>Add:

<Configsections>
<Section name = "rewriterconfig" type = "urlrewriter. config. rewriterconfigserializersectionhandler, urlrewriter"/>
</Configsections>

<! -- The urlrewriter rewrites the rule and does not search for the regular expression on the Internet. At that time, Liu yongfa finished reading the relevant documents in the car for two hours. -->
<Rewriterconfig>
<Rules>
<Rewriterrule>
<Lookfor> ~ /(\ D +). aspx </lookfor>
<Sendto> ~ /Default. aspx? Page = $1 </sendto>
</Rewriterrule>
</Rules>
</Rewriterconfig>

In<System. Web>Add:

<Httpmodules>
<Add type = "urlrewriter. modulerewriter, urlrewriter" name = "modulerewriter"/>
</Httpmodules>
<! --
<Httphandlers>
<Add verb = "*" Path = "*. aspx" type = "urlrewriter. rewriterfactoryhandler, urlrewriter"/>
<Add verb = "*" Path = "*. html" type = "urlrewriter. rewriterfactoryhandler, urlrewriter"/>
</Httphandlers>
-->

6. Add components for form return Persistence:
If your page has a return request. For example, if a DataGrid or gridview is put, a problem may occur when a page is displayed. solution:
Find actionlessform. dll in the project you downloaded and put it in the bin directory of your project.

Then add the following to your page:
<% @ Register tagprefix = "SKM" namespace = "actionlessform" assembly = "actionlessform" %>
Change <form...>:
<SKM: Form ID = "Your form name" method = "Post" runat = "server">
.....
</SKM: Form>

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.