Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

A major newspaper just sent out an email linking out site. The problem is they linked the site as http://example.com/Default.aspx%20%20.

The %20%20 seem to prevent triggering the Custom Error Pages in IIS7. I also tried a URL Rewrite rule but it doesn't seem to work either.

How can I redirect invalid URLs that contain %20%20?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

Although uncommon, adding spaces (that's the %20, it's a space in URL encoded form) at the end of an URL is perfectly valid. It's pretty easy to use URL Rewrite module to permanent redirect visitors to the correct URL:

<rule name="Redirect" stopProcessing="true">
    <match url="^Default\.aspx  $" />
    <action type="Redirect" url="/Default.aspx" />
</rule>

You can also do a rewrite but I would advise to do a permanent redirect to hopefully not give the wrong URL a change to survive on the internet.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.