user170386
user170386

Reputation:

IIS routing configuration error with ASP.NET MVC?

I am unsure if my title was accurate enough. I am trying to make SEO URLs for my website which is developed in ASP.NET MVC. I configured my route to include:

routes.MapRoute(
                "Default",                                                          // Route name
                "{controller}/{action}/{id}/{seo}",                                 // URL with parameters, SEO will up completely optional and used for strings to provide Search Engine Optimization.
                new { controller = "Home", action = "Index", id = "", seo ="" }     // Parameter defaults
            );

On my development machine, a link like:

http://localhost:1048/Home/Post/96/Firefighting+ATV+Concept+Twin+Water+Cannons+Gull

works fine, but once I published to the server (Windows 2008 R2 IIS), it doesn't work. For example, the link:

http://www.otakuwire.net/Home/Post/96/Firefighting+ATV+Concept+Twin+Water+Cannons+Gull

gives me a 404.

Is this a routing issue, or some other issue?

Upvotes: 0

Views: 744

Answers (1)

Peter Seale
Peter Seale

Reputation: 5015

This is an IIS issue, not routing. IIS7 is strict in how it deals with the plus symbol + in URLs. The easy fix is to use the dash - instead like everyone else, or be bold and use the space character (which, personal note, looks horrible in the IE address bar).

On ServerFault they present a configuration-based solution to allow + symbols: https://serverfault.com/questions/76013/iis6-vs-iis7-and-iis7-5-handling-urls-with-plus-sign-in-base-not-querystri

Upvotes: 2

Related Questions