There is a device, an LED display that requests the file 001.htm , in which the text (without html ) transfers data for display. I wrote a website on web forms , in which the aspx page returns data in the required format. In order for the old address to continue to work, I made an elementary rule in the rewrite url , in which 001.htm is replaced with tablo-data.aspx . In the browser, everything works fine, by requesting 001.htm we get the necessary data, only the address in the browser line is changed to the substituted one. And if you look at the requests, you can see that the server for the request GET 001.htm returns the code 302 and the new address where the new request is being executed and the data is returned. But the scoreboard does not know how to go on redirects. It is necessary that the data be returned immediately.
In the description of the url rewrite says that rewrite should be processed within the server and not change the address in the browser. Why doesn't it work for me?
Here is the rule from web.config created by the wizard.

 <rewrite> <rewriteMaps> <rewriteMap name="001.htm"> <add key="001.htm" value="tablo-data.aspx" /> </rewriteMap> </rewriteMaps> <rules> <rule name="htm to aspx" patternSyntax="ExactMatch" stopProcessing="true"> <match url="001.htm" /> <action type="Rewrite" url="tablo-data.aspx" /> </rule> </rules> </rewrite> 
  • Yes, it probably matters: authorization is used on the site and the final URL looks something like this xxxxx.ru/tablo_new/(S(3qhyvkxmp3ottea0hrfyjn2y))/… - Sergei_m
  • Yes, it looks like an authorization. I had to make another small site without authorization, which only returns the data. There rewrite works. But if there is a solution how to do it without breaking the site into two, I will be glad to hear. - Sergei_m

1 answer 1

The redirect works for you because authorization is built on the redirects.

To open access to a specific page without authorization, you must allow anonymous access to it:

 <location path="tablo-data.aspx"> <system.web> <authorization> <allow users="?"/> </authorization> </system.web> </location> 

If it does not help, try again for 001.htm to allow anonymous access too.

  • Nothing changed. The page was opened before without authorization, but through a redirect. The only solution I found was to put the pages you need into a separate folder and declare it a separate application in IIS, which I basically did. The reason is that the authentication settings apply to the entire application and cannot be disabled for an individual item. - Sergei_m