1

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!

1 Answer 1

2

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>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.