문제

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!

도움이 되었습니까?

해결책

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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top