Unfortunately I have a client that is fully invested in a Windows server hosting solution. They have an app out in the wild that has a referring URL in it that looks like
I need to redirect this URL to
so I've created the offending directory and stuck a web.config file in there that looks like:
Which works if someone types in
without the trailing slash, but breaks the page if someone clicks on the
with the trailing slash because the trailing slash is getting passed to the destination URL like
even though the redirect hasn't got a slash.
How can I write the redirect to omit the slash in the referring URL? I've spent a couple hours scouring G for an answer to no avail. Any help would be most welcome.
Code:
http://www.domain.com/directory/
I need to redirect this URL to
Code:
http://www.domain.com/somepage.php
Code:
<configuration>
<system.webServer>
<httpRedirect enabled="true" destination="http://www.domain.com/sompage.php" httpResponseStatus="Permanent" />
</system.webServer>
</configuration>
Which works if someone types in
Code:
http://www.domain.com/directory
Code:
http://www.domain.com/directory/
Code:
http://www.domain.com/sompage.php/
How can I write the redirect to omit the slash in the referring URL? I've spent a couple hours scouring G for an answer to no avail. Any help would be most welcome.