I have an ASP.NET MVC app that is working with some handfuls of controllers, e.g. "Home", "Services" and "Go" "Go" is the controller where all the content is.
Now people with marketing have come and say that they do not want to see the word "go" in the URL. In other words, instead of:
http://mydomain.com/go/geography/africa They want: < Pre> http://mydomain.com/geography/africa I can not make one controller for all the routes they want ... then there is no way to write Is my routing in Global.asax.cs such that the request for "services" and "home" will be treated as normal, but anything will be routinely rooted for "bay" controller?
Are you on IIS 7? Rather than hacking your routes in Global.asax.cs , it may be easier to rewrite the URL on the server easier. Edit: I have only done rewriting URLs in Apache, for whatever is done, it will be done like this: < Pre> RewriteEngine On RewriteRule ^ go / (. +)$ / $ 1 [R = 301, L] And look forward to working in IIS 7 Provide enough information to be enabled
Comments
Post a Comment