简体   繁体   中英

Web.config IIS rewrite rule to ignore specific file

I have a site txt map sitemaphttp.txt on my site. I redirect all my traffic to HTTPS. I still want Google to be able to read this sitemap, so it won't read it from https://example.com/sitemaphttp.txt but from http://example.com/sitemaphttp.txt . What rewrite rule I need to add to web.config so it will ignore all the other rules and just let that specific file through.

To link to a custom site-map provider from a parent site map

  1. From the parent site map, create a SiteMapNode in the location in the navigation structure where you want the child site map to be displayed.

    For example, if you are using the default XmlSiteMapProvider class, open the Web.sitemap file and add the following SiteMapNode in the appropriate location in the hierarchy:

<siteMapNode provider="SimpleTextSiteMapProvider" />

Note

The provider attribute corresponds to the provider's name attribute in the Web.config file.

  1. Add the custom site-map provider to the Web.config file by using an add element. The following code adds the custom provider named SimpleTextSiteMapProvider, but maintains XmlSiteMapProvider as the default site-map provider.

    <configuration> <!-- other configuration sections --> <system.web> <!-- other configuration sections --> <siteMap defaultProvider="XmlSiteMapProvider"> <providers> <add name="SimpleTextSiteMapProvider" type="Samples.AspNet.SimpleTextSiteMapProvider,Samples.AspNet" siteMapFile = "siteMap.txt" /> </providers> </siteMap> </system.web> </configuration>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM