Search code examples
iis-7asp-classicvbscriptweb-configisapi-rewrite

ASP/VBSCRIPT URL Trailing dots issue


i've got a problem whereby some websites linking into mine have truncated the URL with trailing dots, 3 of them to be exact!

eg. http://www.mywebsite.com/7542-this-is-a-link-to...

The url should be http://www.mywebsite.com/7542-this-is-a-link-to-my-website.html

Naturally, ISAPI rewrite doesn't understand the truncated url so I need to do a redirect to the correct url using a 301 redirect

Something like:

RewriteRule ^7542-this-is-a-link-to... /7542-this-is-a-link-to-my-website.html [L,R=301]

But for the life of me I cannot get ISAPI rewrite to match against the 3 dots, annoyingly the incorrect URL doesn't even 404 redirect! I have no idea where it is going to... Just a blank screen so am guessing it has something to do with IIS web.config file...

Please help me before I become balder than I already am!


Solution

  • The could be several different reasons for that. Basically the rule like:

    RewriteRule ^7542-this-is-a-link-to.* /7542-this-is-a-link-to-my-website.html [L,R=301]
    

    would fix the problem, matching everything after "-to". But it's not ISAPI_Rewrite that throws 404. It's IIS. I had issues before and all googling ended up with IIS blocking suspicious characters. Try to tweak that.

    It could be this "dots in the URL"

    This thread has a lot of useful info