I’ve seen that IIS has a problem with letting colons into URLs. I also saw the suggestions others offered here.
With the site I’m working on, I want to be able to pass titles of movies, books, etc., into my URL, colon included, like this:
mysite.com/Movie/Bob:The Return
This would be consumed by my MovieController, for example, as a string and used further down the line.
I realize that a colon is not ideal. Does anyone have any other suggestions? As poor as it currently is, I’m doing a find-and-replace from all colons (:) to another character, then a backwards replace when I want to consume it on the Controller end.
Consider URL encoding and decoding your movie titles.
You’d end up with
foo.com/bar/Bob%58The%20ReturnAs an alternative, consider leveraging an HTML helper to remove URL unfriendly characters in URLs (method is
URLFriendly()). The SEO benefits between a colon and a placeholder (e.g. a dash) would likely be negligable.