Windows server URL redirect question

Fatbat

Advertise Here
May 10, 2008
6,994
149
0
Costa del Sol, Spain
www.deepbass.com
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

Code:
http://www.domain.com/directory/

I need to redirect this URL to
Code:
http://www.domain.com/somepage.php
so I've created the offending directory and stuck a web.config file in there that looks like:

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
without the trailing slash, but breaks the page if someone clicks on the
Code:
http://www.domain.com/directory/
with the trailing slash because the trailing slash is getting passed to the destination URL like
Code:
http://www.domain.com/sompage.php/
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.
 


Those are great.

ifSofWr.gif


Someone needs to put this human bot out of its misery.