Question

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!

Was it helpful?

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

OTHER TIPS

I'm totally ignorant of Microsoft internet tech, but is there any chance that the three dots in the incoming URL are actually a single "ellipsis" character (… not ...)? If so, you'd need to use that character in your RewriteRule. You'd have to check the docs to know how to correctly encode that character for the config file.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top