Domanda

Very strange thing; I'm using the following in web.config file to redirect everything from one domain to specific page on another domain:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <httpRedirect enabled="true" destination="http://www.example.com/my-page.html" />
  </system.webServer>
</configuration>

However, trailing slash is appended to the URL, resulting in a 404:

http://www.example.com/my-page.html/

How can I force redirect WITHOUT the trailing slash?

Thanks!

È stato utile?

Soluzione

add exactDestination="true" to your config. It should look like this

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <httpRedirect enabled="true" destination="http://www.example.com/my-page.html" exactDestination="true" />
  </system.webServer>
</configuration>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top