Solution for the original static file cannot be opened after URL redirection is enabled for the website

Source: Internet
Author: User

1. actionlessform. CS is used to rewrite form to process the original URL after PostBack sending.

Web. config Configuration

<Httpmodules>
<Add type = "ruonanxiao. config. modulerewriter, ruonanxiao. config" name = "modulerewriter. cs"/>

ProgramSet. Class Name, assembly name = file. CS
</Httpmodules>

<Configsections>
<Section name = "rnxrewirter" type = "ruonanxiao. config. rewriterconfigserializersectionhandler, ruonanxiao. config"/>

</Configsections>

Then write the ruonanxiao. config assembly.

You also need to set the ing of iis.html.

Click the Add button

Select. aspx for A. html extension path.

In this way, the new rule will take effect.

However, the original. HTML static file cannot be opened. What should I do with this change? You can solve the problem as follows.

1. Web. config

Add a configuration Node

<Httphandlers>

<! -- Set Application ing (the one to be added after URL rewriting) -->
<Add Path = "*. html" verb = "*" type = "system. Web. UI. pagehandlerfactory" Validate = "true"/>
</Httphandlers>

2. <compilation>
<! -- Set Application ing (the one to be added after URL rewriting) -->
<Buildproviders>
<Add extension = ". html" type = "system. Web. Compilation. pagebuildprovider"/>
</Buildproviders>

In this case, we can open the name of the original. html suffix...

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.