ASP.NET MVC - how to modify requested URLs?
Posted
by Marek
on Stack Overflow
See other posts from Stack Overflow
or by Marek
Published on 2010-05-08T08:51:29Z
Indexed on
2010/05/08
8:58 UTC
Read the original article
Hit count: 214
The baidu spider seems to be adding ¤
to end of some crawled urls (it seems that it happens with urls containing single unicode character as the last character)
The baidu-requested url looks like this:
site.com/abc/ä¤
while
site.com/abc/ä
is the valid url and as linked from many places on my site.
The internal problem is that a different route is matched for this kind of url and an unhandled exception occurs.
I would not like to lose baidu because of too many 500 errors on the site.
I would like to change the requested URL to a different URL by removing the added character before any ASP.NET MVC processing of the request starts.
Can I write a request filter/http module or something similar in ASP.NET MVC to remove the trailing '¤' from the urls? I would not like to alter my routes to counter-hack this behavior.
© Stack Overflow or respective owner