Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make IIS 7.5 pass *.xml requests to asp.net

Tags:

c#

asp.net

iis

How do I configure IIS 7.5 to forward all *.xml file requests to asp.net engines so i can handle them in Global.asax and rewrite the path to a *.aspx file? Now IIS is expecting to find them directly on disk. I will use this do dynamically generate my sitemap.xml

like image 602
Andreas Avatar asked Dec 03 '25 21:12

Andreas


1 Answers

You can force static files to go through the ASP.NET pipeline by editing your web.config:

<system.webServer>
    <handlers>
      <add name="XMLHandler" type="System.Web.StaticFileHandler" path="*.xml" verb="GET"  />
    </handlers>
</system.webServer>
  1. HTTP Handlers and HTTP Modules Overview
  2. How to: Register HTTP Handlers
like image 68
MikeSmithDev Avatar answered Dec 05 '25 11:12

MikeSmithDev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!